how GDB use ptrace to return from a function
Jan Kratochvil
jan.kratochvil@redhat.com
Sat Nov 18 07:58:00 GMT 2017
On Sat, 18 Nov 2017 05:03:11 +0100, Joel Brobecker wrote:
> > what break point events are common for X86?
>
> IIRC, the breakpoint instruction on x86 is the int3 instruction.
> It should generate a SIGTRAP upon execution, just like any user-
> inserted breakpoints.
A toy debugger should have available also a hardware breakpoint (hbreak) using
the hardware registers commonly used only for hardware watchpoints.
Then the return address can be arbitrary as the debugger does not have to
write anything into that address.
Jan
More information about the Gdb
mailing list