Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jul 2009 18:11:25 +0300
From:      "Diskin, Gal" <gal.diskin@intel.com>
To:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   ptrace question
Message-ID:  <D371C87D96871F4391E9F3B7085A1A62A6468FB2@hasmsx502.ger.corp.intel.com>

next in thread | raw e-mail | index | archive | help
Hi,
I'm using ptrace to execute one application under the control of another (s=
urprisingly :P). I'm trying to find the number of the last system call exec=
uted 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 kern=
el 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=3DFREEBSD72#L118) seems to be the place the con=
version is taking place. However, in spite the comment at the top of the co=
nversion function mentioning that the translation is not straightforward, t=
he 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 e=
xecuted in the traced application from the tracing application (using ptrac=
e)?

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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D371C87D96871F4391E9F3B7085A1A62A6468FB2>