Problems with hook-stop
Christian Thalinger
twisti@complang.tuwien.ac.at
Thu Sep 27 12:35:00 GMT 2007
On Wed, 2007-09-26 at 01:33 -0700, Carl Shapiro wrote:
> Hi,
>
> I am trying to write a user-defined command hook that automatically
> passes a SIGTRAP to my program. Here is the definition I am working
> with:
>
> define hook-stop
> if (((* (char *) ($pc - 1)) & 0xff) == 0xcc)
> signal SIGTRAP
> end
> end
Hi!
I'm also searching for a solution for that problem. The reason why we
want to use the INT3 instruction on i386 and x86_64 is because we must
be able to replace a machine instruction atomically in our JIT compiler
(where "atomically" reads as "the patching instruction must not be
shorter than the patched one", for obvious reasons). And INT3 is the
only instruction that is suitable.
Right now we're using UD2, but that's only a temporary solution.
- twisti
More information about the Gdb
mailing list