Java Reference
In-Depth Information
until the method exits. At that point, the program is suspended at the line imme-
diately following the method call that got you into the method in the first place.
Running to the cursor location (Alt+F9)
The debugger provides a handy way to suspend the program at any point in your
source file without requiring you to set up a line number breakpoint. While run-
ning under the debugger, place your cursor on the line at which you wish to sus-
pend execution, and click the Run to Cursor icon or press Alt+F9 . Program
execution resumes, suspending immediately before executing the line you're on.
This function follows the same rules as the line number breakpoint: You must
place your cursor on an executable line of code, not a blank line or comment.
This can be a quick way to bypass uninteresting or long-running sequences of
code that you encounter while tracing program execution. It's a great way to
bypass long, iterative loops.
Backing out of the current frame of execution (Pop Frame)
The powerful Pop Frame feature lets you roll back the current frame of execution
to the previous execution point. This is referred to popping off the current stack
frame, as described later in this chapter. This effectively takes you back in the
sequence of execution so you can rerun sequences of application logic.
6.3.4
Working with threads
Most Java applications utilize multithreading to some degree. Each thread oper-
ates independently and thus has its own stack frames. Because of this, IDEA allows
you to examine each thread independently.
Accessing the threads list
The debugger shows your program's threads in two locations. The primary view
of threads is through the Threads tab of the Debug window, as shown in
figure 6.5. Each thread is shown along with its stack frames, optionally organized
into their thread groups. From here, you can peek into whatever thread is of
interest to you. The colors of the icons indicate the status of the threads and their
thread groups. These icons are explained in table 6.4. Beside each thread
instance is the thread's name (if any) and current status:
RUNNING —The thread is active and running.
WAIT —The thread is waiting for a monitor.
UNKNOWN —The state of the thread can't be determined accurately.
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search