Java Reference
In-Depth Information
continually reports information about the state of your program to the debug-
ger, which in turn displays the data to you in a meaningful way.
IDEA uses the Java Platform Debugger Architecture ( JPDA ), a technology
built into the Java2 platform, as a source of debugging information. If
you're developing an application using Java 1.1 or earlier, you won't be
able to use the debugger.
WARNING
Stepping through your program
The debugger allows you to step through each line of source code at whatever
pace you desire. This lets you follow each step logically, evaluating the results and
observing program flow. You can choose to examine every line as it's executed or
skip ahead to meaningful parts of the code you wish to observe more closely.
Examining the values of variables and program state
As you step through the program, you have the opportunity to examine the inter-
nal values of your classes to see if they contain what you expect them to. You can
peek inside collections and arrays, evaluate the output of methods, and examine
instance variables. The debugger also presents information about the current
state of execution, the call stack, and your program's threads in order to help you
understand exactly what your program is doing.
Changing data values on the fly to observe the results of potential changes
Beyond strict observational capabilities, the debugger also lets you tweak values
on the fly in order to observe the results. For example, you can force a method to
return false instead of true, and observe the outcome; or skip to the end of a loop
by incrementing its counter.
6.2 Working with breakpoints
Breakpoints are source code markers used to trigger actions during a debugging
session. Typically, the purpose behind setting a breakpoint is to suspend program
execution to allow you to examine program data. However, IDEA can use break-
points as triggers for a variety of different actions, as you'll learn in this section.
Breakpoints can be set at any time during the debugging process, including prior
to launching your program in the debugger. Your breakpoints won't affect your
Java source code files directly, but breakpoints and their settings are saved with
your IDEA project so you can reuse them across debugging sessions.
 
 
 
 
 
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search