This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problems with hook-stop


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]