title: How do debuggers guarantee correctness when using INT 3 (0xCC) software breakpoint even though an instruction was patched?
body: <p>I've read that the INT 3 (0xCC) is used for software breakpoints.</p>
  
  <p>It is set by (for instance) a debugger by overwriting the actual program code in memory.</p>
  
  <p>I've also read that INT 3 is a "trap" not "fault" exception meaning the address pushed on the stack is the address of the instruction following the INT3 instruction.</p>
  
  <p>How does the debugger guarantee correctness if the patched instruction is not re-executed?</p>