Correctness of trap-based breakpoint implementations

  • Authors:
  • Norman Ramsey

  • Affiliations:
  • Bell Communications Research, Morristown, NJ

  • Venue:
  • POPL '94 Proceedings of the 21st ACM SIGPLAN-SIGACT symposium on Principles of programming languages
  • Year:
  • 1994

Quantified Score

Hi-index 0.00

Visualization

Abstract

It is common for debuggers to implement breakpoints by a combination of planting traps and single stepping. When the target program contains multiple threads of execution, a debugger that is not carefully implemented may miss breakpoints. This paper gives a formal model of a breakpoint in a two-threaded program. The model describes correct and incorrect breakpoint implementations. Automatic search of the model's state space shows that the correct implementation does miss a breakpoint. The results apply even to debuggers like dbx and gdb, which are apparently for single-threaded programs; when the user evaluates an expression containing function calls, the debugger executes the call in the target address space, in effect creating a new thread.