i was trying to use 8l's '-e' flag today, when i found some
interesting problems.

first, -e doesn't do what it says unless you pass -p, which goes
unmentioned in the manual page. (luckily i read the source).

second, and more importantly, the calls to _tracein/_traceout are
skipped, as in the following disassembly, but i can't determine why. is
there some tool (besides noping with acid) meant to be used to 'turn on'
the tracing calls?

third, when you use -e with -p, prof.$pid files are generated as with
-p, but the prof files are empty. this seems unintentional.

this example is using rc.

; 8l -p -e -o 8.out code.8 exec.8 getflags.8 glob.8 here.8 io.8 lex.8
pcmd.8 pfnc.8 simple.8 subr.8 trap.8 tree.8 var.8 havefork.8 plan9.8
y.tab.8
; acid 8.out
8.out:386 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/386
acid: asm(setvar)
setvar 0x0000adbb   JMP setvar+0x7(SB)
setvar+0x2 0x0000adbd   CALL    _tracein(SB)
setvar+0x7 0x0000adc2   SUBL    $0x10,SP
setvar+0xa 0x0000adc5   MOVL    name+0x0(FP),CX
setvar+0xe 0x0000adc9   MOVL    CX,0x0(SP)
setvar+0x11 0x0000adcc  CALL    vlook(SB)
setvar+0x16 0x0000add1  MOVL    AX,v+0xc(SP)
setvar+0x1a 0x0000add5  MOVL    0x4(AX),AX
setvar+0x1d 0x0000add8  MOVL    AX,0x0(SP)
setvar+0x20 0x0000addb  CALL    freewords(SB)
setvar+0x25 0x0000ade0  MOVL    v+0xc(SP),DX
setvar+0x29 0x0000ade4  MOVL    val+0x4(FP),CX
setvar+0x2d 0x0000ade8  MOVL    CX,0x4(DX)
setvar+0x30 0x0000adeb  MOVL    $0x1,0x8(DX)
setvar+0x37 0x0000adf2  ADDL    $0x10,SP
setvar+0x3a 0x0000adf5  RET
setvar+0x3b 0x0000adf6  CALL    _traceout(SB)
setvar+0x40 0x0000adfb  RET
Xasync 0x0000adfc   JMP Xasync+0x7(SB)
acid: 

you can see there is a JMP over _tracein and a RET before _traceout.
what gives?

Attachment: pgpKVkRxWkLd9.pgp
Description: PGP signature

Reply via email to