Apex › Systems & OS

How a debugger breakpoint works

The surprising trick behind every breakpoint. Your code runs at full speed, so the debugger cannot watch each instruction — instead it overwrites one byte at the target address with 0xCC (the x86 INT3 opcode). When the CPU hits it, INT3 traps and SIGTRAP stops the process for the debugger to inspect via ptrace. A narrated walk plus a live step through set → trap → inspect → continue, watching the byte flip between 0xCC and the real instruction.

More in Systems & OS