Java Reference
In-Depth Information
The Pass count condition is mutually exclusive with any other condition-
al operation.
WARNING
6.2.7
Configuring breakpoint actions
By default, new breakpoints are configured to suspend the program to let you
examine it in the debugger's frame viewer. In addition, IDEA lets you create
breakpoints that generate console messages when triggered.
Suspending the program
The Suspend VM execution action tells the debugger to pause the program's
execution when the breakpoint is reached, assuming any conditions that have
been assigned to it have been met. Once suspended, the top stack frame is shown
in the debugger's frame view. From that point, you can examine the program's
state or use the debugger's stepping functions to resume execution (you'll learn
about these functions in detail later in this chapter).
Logging a message to the console
Enabling the Log message to console option lets you display the reaching of the
breakpoint as text message in the debugger's console tab. This option is useful for
following the code's progress without having to suspend the program's execution
(deselect the Suspend VM execution option.)
The actual message text is determined by the debugger; it says which break-
point was reached, at what line number of which class. For more control of the
message, see the following option, which lets you log an arbitrary expression to
the console.
Logging an expression to the console
This option lets you evaluate an expression in the breakpoint's context and dis-
play its value to the debugging console. Like the Log message to console option,
this feature lets you obtain information about your running application without
having to suspend its execution. This is an excellent alternative to inserting a
bunch of print statements into your programs.
To enable this feature, select the checkbox and enter any valid Java expression
into the option field. When the breakpoint is reached, this expression is evalu-
ated, and the results, along with the original expression, are displayed in the con-
sole. If your expression evaluates to an object, the console shows the output of its
toString() method.
 
 
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search