[Openmcl-devel] Another linux86-32: signed doubleword parameters.

David Brown lisp at davidb.org
Mon Oct 13 22:19:56 PDT 2008


On Mon, Oct 13, 2008 at 10:26:36PM -0600, Gary Byers wrote:

> regs[REG_EDI] should contain contain the function; subtracting the
> value regs[REG_EDI] from that of regs[EDI_EIP] should show the relative
> offset of the program counter within that function.  Doing:
>
> (gdb) call print_lisp_object(<value_of_regs[REG_EDI])
>
> will try (using the kernel debugger's imperfect but sometimes useful)
> lisp-object printer.  ("call" in gdb sometimes gets confused but often
> works)

(gdb) call print_lisp_object(0x1400a71e)
$4 = 0x807a640 "#<Function %COPY-IVECTOR-TO-IVECTOR #x1400A71E>"
(gdb) p regs[14] - regs[4]
$5 = 59

The interesting part is that the code looks like it is marking temp1
as immediate, so seems fine.

Let me know if you want me to poke into anything else.

CL-USER> (disassemble 'ccl::%copy-ivector-to-ivector)
   (recover-fn)                                                                                                     
   (movl (@ 12 (% esp)) (% temp0))                 ;[5]                                                             
   (movl (@ 8 (% esp)) (% temp1))                  ;[9]                                                             
   (movl (% arg_z) (% imm0))                       ;[13]                                                            
   (sarl ($ 2) (% imm0))                           ;[15]                                                            
   (pushl (% arg_z))                               ;[18]                                                            
   (movl (@ 8 (% esp)) (% arg_z))                  ;[19]                                                            
   (andb ($ 251) (@ (% fs) 8))                     ;[23]                                                            
   (andb ($ 191) (@ (% fs) 8))                     ;[32]                                                            
   (sarl ($ 2) (% temp1))                          ;[41]                                                            
   (sarl ($ 2) (% arg_y))                          ;[44]                                                            
   (cmpl (% arg_z) (% temp0))                      ;[47]                                                            
   (jne L55)                                       ;[49]                                                            
   (cmpl (% temp1) (% arg_y))                      ;[51]                                                            
   (jg L77)                                        ;[53]                                                            
L55                                                                                                                
   (testl (% imm0) (% imm0))                                                                                        
   (jmp L73)                                       ;[57]                                                            
L59                                                                                                                
   (movb (@ -2 (% temp0) (% temp1)) (% imm0.b))                                                                     
   (movb (% imm0.b) (@ -2 (% arg_z) (% arg_y)))    ;[63]                                                            
   (incl (% temp1))                                ;[67]                                                            
   (incl (% arg_y))                                ;[68]                                                            
   (subl ($ 4) (@ (% esp)))                        ;[69]                                                            
L73                                                                                                                
   (jne L59)                                                                                                        
   (jmp L101)                                      ;[75]                                                            
L77                                                                                                                
   (addl (% imm0) (% temp1))                                                                                        
   (addl (% imm0) (% arg_y))                       ;[79]                                                            
   (testl (% imm0) (% imm0))                       ;[81]                                                            
   (jmp L99)                                       ;[83]                                                            
L85                                                                                                                
   (decl (% temp1))                                                                                                 
   (decl (% arg_y))                                ;[86]                                                            
   (movb (@ -2 (% temp0) (% temp1)) (% imm0.b))    ;[87]                                                            
   (movb (% imm0.b) (@ -2 (% arg_z) (% arg_y)))    ;[91]                                                            
   (subl ($ 4) (@ (% esp)))                        ;[95]                                                            
L99                                                                                                                
   (jne L85)                                                                                                        
L101                                                                                                               
   (addl ($ 4) (% esp))                                                                                             
   (xorl (% temp1) (% temp1))                      ;[104]                                                           
   (orb ($ 4) (@ (% fs) 8))                        ;[106]                                                           
   (xorl (% arg_y) (% arg_y))                      ;[115]                                                           
   (orb ($ 64) (@ (% fs) 8))                       ;[117]                                                           
   (retl ($ 20))                                   ;[126]                                                           

David



More information about the Openmcl-devel mailing list