On Mon, Feb 16, 2004 at 09:08:55AM +0100, Leopold Toetsch wrote:
> I see. Your libc's sprintf seems to be missing the "0x" prefix for the
> "%p" format.
Ok you were right, that fixed it immediatly, and I'm now able to
see "within jit" :).  Attached are the dumps for this loop, with
and without the print in between.

Looking at it makes it pretty clear why it loops forever (mainly
it jumps back to a load, loading always the same value). Somehow
it relates to the way these "jit sections" are built afaik, but
still do have to dig more and understand better its works.

(if there are any hints/pointers, they are greatly appreciated ;)
Thanks again for the help,
Stephane

PS.: apoligize for the delay in answering back.

Also concerning fixing the debug part, I kind of prefer your second
option (using Parrot_sprintf) since as I understand it its meant
to avoid platform specific quirks?
0x00266570 <jit_func+0>:        save  %sp, -104, %sp
0x00266574 <jit_func+4>:        add  %i0, 0, %i2
0x00266578 <jit_func+8>:        sethi  %hi(0x266400), %i3
0x0026657c <jit_func+12>:       or  %i3, 0x130, %i3     ! 0x266530
0x00266580 <jit_func+16>:       sethi  %hi(0xfee70000), %l0
0x00266584 <jit_func+20>:       or  %l0, 0xa0, %l0      ! 0xfee700a0
0x00266588 <jit_func+24>:       sub  %i1, %l0, %l0
0x0026658c <jit_func+28>:       ld  [ %i3 + %l0 ], %l0
0x00266590 <jit_func+32>:       jmpl  %l0, %l0
0x00266594 <jit_func+36>:       nop
0x00266598 <jit_func+40>:       mov  2, %l1     ! 0x2
0x0026659c <jit_func+44>:       st  %l1, [ %i2 + 4 ]
0x002665a0 <jit_func+48>:       ld  [ %i2 + 4 ], %l1
0x002665a4 <jit_func+52>:       dec  %l1
0x002665a8 <jit_func+56>:       nop
0x002665ac <jit_func+60>:       cmp  %l1, 0
0x002665b0 <jit_func+64>:       nop
0x002665b4 <jit_func+68>:       bne,a   0x2665a0 <jit_func+48>
0x002665b8 <jit_func+72>:       nop
0x002665bc <jit_func+76>:       st  %l1, [ %i2 + 4 ]
0x002665c0 <jit_func+80>:       sethi  %hi(0xfee70000), %o0
0x002665c4 <jit_func+84>:       or  %o0, 0xc4, %o0      ! 0xfee700c4
0x002665c8 <jit_func+88>:       call  0x8a43c <Parrot_print_sc>
0x002665cc <jit_func+92>:       mov  %i0, %o1
0x002665d0 <jit_func+96>:       ret
0x002665d4 <jit_func+100>:      restore

# -- pasm used:
       set   I1, 2
LOOP:  sub   I1, 1
       if    I1, LOOP
       print "end\n"
       end
0x00266f10 <jit_func+0>:        save  %sp, -104, %sp
0x00266f14 <jit_func+4>:        add  %i0, 0, %i2
0x00266f18 <jit_func+8>:        sethi  %hi(0x266c00), %i3
0x00266f1c <jit_func+12>:       or  %i3, 0x2c8, %i3     ! 0x266ec8
0x00266f20 <jit_func+16>:       sethi  %hi(0xfee70000), %l0
0x00266f24 <jit_func+20>:       or  %l0, 0xa0, %l0      ! 0xfee700a0
0x00266f28 <jit_func+24>:       sub  %i1, %l0, %l0
0x00266f2c <jit_func+28>:       ld  [ %i3 + %l0 ], %l0
0x00266f30 <jit_func+32>:       jmpl  %l0, %l0
0x00266f34 <jit_func+36>:       nop
0x00266f38 <jit_func+40>:       mov  2, %l1     ! 0x2
0x00266f3c <jit_func+44>:       st  %l1, [ %i2 + 4 ]
0x00266f40 <jit_func+48>:       ld  [ %i2 + 4 ], %l1
0x00266f44 <jit_func+52>:       dec  %l1
0x00266f48 <jit_func+56>:       st  %l1, [ %i2 + 4 ]
0x00266f4c <jit_func+60>:       sethi  %hi(0xfee70000), %o0
0x00266f50 <jit_func+64>:       or  %o0, 0xb8, %o0      ! 0xfee700b8
0x00266f54 <jit_func+68>:       call  0x8a254 <Parrot_print_i>
0x00266f58 <jit_func+72>:       mov  %i0, %o1
0x00266f5c <jit_func+76>:       ld  [ %i2 + 4 ], %l1
0x00266f60 <jit_func+80>:       nop
0x00266f64 <jit_func+84>:       cmp  %l1, 0
0x00266f68 <jit_func+88>:       nop
0x00266f6c <jit_func+92>:       bne,a   0x266f40 <jit_func+48>
0x00266f70 <jit_func+96>:       nop
0x00266f74 <jit_func+100>:      sethi  %hi(0xfee70000), %o0
0x00266f78 <jit_func+104>:      or  %o0, 0xcc, %o0      ! 0xfee700cc
0x00266f7c <jit_func+108>:      call  0x8a43c <Parrot_print_sc>
0x00266f80 <jit_func+112>:      mov  %i0, %o1
0x00266f84 <jit_func+116>:      ret
0x00266f88 <jit_func+120>:      restore

# -- pasm used:
       set   I1, 2
LOOP:  sub   I1, 1
       print I1
       if    I1, LOOP
       print "end\n"
       end
0x00263660 <jit_func+0>:        save  %sp, -104, %sp
0x00263664 <jit_func+4>:        add  %i0, 0, %i2
0x00263668 <jit_func+8>:        sethi  %hi(0x243c00), %i3
0x0026366c <jit_func+12>:       or  %i3, 0x2c8, %i3     ! 0x243ec8
0x00263670 <jit_func+16>:       sethi  %hi(0xfee70000), %l0
0x00263674 <jit_func+20>:       or  %l0, 0xa0, %l0      ! 0xfee700a0
0x00263678 <jit_func+24>:       sub  %i1, %l0, %l0
0x0026367c <jit_func+28>:       ld  [ %i3 + %l0 ], %l0
0x00263680 <jit_func+32>:       jmpl  %l0, %l0
0x00263684 <jit_func+36>:       nop
0x00263688 <jit_func+40>:       mov  0x14d, %l1 ! 0x14d
0x0026368c <jit_func+44>:       st  %l1, [ %i2 + 4 ]
0x00263690 <jit_func+48>:       ret
0x00263694 <jit_func+52>:       restore
0x00263698 <jit_func+56>:       st  %l1, [ %i2 + 4 ]

# -- pasm used:
set I1, 333
end

Reply via email to