Threads/Stack Overview

The Threads/Stack window displays information for the current project. While the debugger is running, choose Debug -> Threads/Stack, to open the Threads/Stack window.

Using the Thread/Stack window you can:

When you first open the Threads/Stack window, the stack frame in which program execution stopped is highlighted. Click the + and - icons to expand and contract the thread groups, threads, stacks, and variables.

Thread Groups

Initially, the Threads/Stack window lists the following thread groups that make up the current project:

Threads

Click the + icon next to the glyph to list the threads that make up a thread group.

Each thread is in the form of:

"AWT-Motif" (java.lang.Thread) at breakpoint (priority 5)

for example.

Where, in the thread example above:

The glyph accompanying a thread is an additional clue as to the state of the thread. In all, a thread can be in one of seven states:

The state of the thread cannot be determined.
Thread is a zombie (has been exited, but has not yet been reaped or has been constructed but not yet started).
Thread is running.
Thread is sleeping.
Thread is waiting on a conditional variable.
Thread is suspended.
Thread is stopped at a breakpoint.

Stack Frames

When you expand a thread in the Threads/Stack window, the stack frames in the thread are shown. Each stack frame is marked with the icon.

The stack frames are listed in the order in which they were called. The stack frame that was executing when the program stopped is at the top of the stack. The initial stack frame is at the bottom of the stack. If a class does not have a stack frame, try recompiling your program with the -g option.

Local Variables

Expanding a stack frame displays the arguments and local variables. Objects are marked with the icon. When you expand an object, all data members of the object are shown. Although only the first 100 elements of an array are shown.

You can repeat this action on nested objects. Local variables that are out of scope are not shown.