Open dstolfa opened 2 years ago
When generate a DIFO such as one generated by:
sudo dtrace -SeEn 'vm*:syscall::open:entry { printf("opening file: %s", basename(copyinstr(arg0))); }'
we get:
DIFO 0x60e000001a80 returns string (unknown) by ref (size 256) OFF OPCODE INSTRUCTION 00: 29010601 ldgs DT_VAR(262), %r1 ! DT_VAR(262) = "arg0" 01: 33000000 flushts 02: 25000002 setx DT_INTEGER[0], %r2 ! 0x40 03: 04010201 sll %r1, %r2, %r1 04: 2e010201 sra %r1, %r2, %r1 05: 54000101 typecast DT_SYMBOL[1], %r1 ! "uintptr_t" 06: 31ff0001 pushtv DT_TYPE(255), %r1 07: 2f000901 call DIF_SUBR(9), %r1 ! copyinstr 08: 33000000 flushts 09: 54000b01 typecast DT_SYMBOL[11], %r1 ! "char *" 10: 25000102 setx DT_INTEGER[1], %r2 ! 0x100 11: 30010201 pushtr DT_TYPE(1), %r2, %r1 ! DT_TYPE(1) = string 12: 2f001901 call DIF_SUBR(25), %r1 ! basename 13: 23000001 ret %r1
which is wrong because instruction 10 assumes a size. This may not be a bug since this is for a string and we just do best effort assumption on the host, however it would be good to double-check this.
When generate a DIFO such as one generated by:
we get:
which is wrong because instruction 10 assumes a size. This may not be a bug since this is for a string and we just do best effort assumption on the host, however it would be good to double-check this.