4.3. The Debugger

The debugger allows you to step through the execution of a program and stop at any point you choose so that you can track down bugs in your code. What makes our debugger an unusually powerful tool is that it allows you to modify the values of fields and variables while debugging!. First, we will explain a little bit about how the debugger works in general, and then we will explain how you can use the Interactions Pane to modify field and variable values during runtime and thus more quickly zero in on problems in your code.

To enable the debugger, select "Debugger, Debug Mode". This will launch the debug panel in the lower part of DrJava, right above the Interactions Pane.

Debug Panel: The Debug Panel has four tabs to help you track control flow in your program. These tabs are labeled Watches, Breakpoints, Stack, and Threads.