ptrace question

Diskin, Gal gal.diskin at intel.com
Sun Jul 26 15:39:54 UTC 2009


Hi,
I'm using ptrace to execute one application under the control of another (surprisingly :P). I'm trying to find the number of the last system call executed in the traced process from the tracing process. In Linux this is done using "orig_eax" (or "orig_rax") but as far as I can tell it does not have a counterpart in FreeBSD (correct me if I'm wrong). I've looked at the kernel sources in hope of finding out how the conversion was done in the Linux emulation layer. The file linux_ptrace.c (http://fxr.watson.org/fxr/source/i386/linux/linux_ptrace.c?v=FREEBSD72#L118) seems to be the place the conversion is taking place. However, in spite the comment at the top of the conversion function mentioning that the translation is not straightforward, the translation done is simply copying eax to orig_eax.

My question is: Is there a way to find the number of the last system call executed in the traced application from the tracing application (using ptrace)?

Thanks,
Gal Diskin
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


More information about the freebsd-hackers mailing list