Re: how GDB use ptrace to return from a function
Jan Kratochvil <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
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