Implementation and Evaluation of Data Breakpoint Schemes in an Interactive Debugger

Paul E. Roberts
Department of Computer Science
University of Utah, Salt Lake City, UT 84112
peroberts@cs.utah.edu

Master's Thesis
June/December, 1996

Abstract

Interactive debuggers allow users to specify conditions upon which the debugger stops the program being debugged so that the user can examine the state of the program. This stopping point is usually called a breakpoint. The most commonly used form of breakpoint, a control breakpoint, specifies the place in the program to stop. This type of breakpoint is well understood and implemented efficiently in most debuggers. Watchpoints are a special kind of breakpoint, a data breakpoint, that stop the program when the value of an expression changes. It has proven difficult to develop efficient watchpoint implementations and although a number of efficient mechanisms have been proposed, most debuggers still use the simplest and slowest. I have implemented variants of watchpoints in GDB, the GNU source-level debugger. This work shows that there are a number of practical implementations of watchpoints that perform much better than the common implementation. The watchpoint implementations that I evaluated outperformed GDB's simplistic implementation by factors of 20 to 50,000. I conclude that the most efficient implementations do much of the work outside the debugger, that is, either in the operating system kernel or in the program being debugged.

Full thesis.