The debugger helps you find and fix errors in your programs. When you begin a debugging session, the debugger user interface is displayed in the message pane:
The debugger allows you to debug multiple processes in multiple debugging sessions. Processes can be in the same JBuilder project, or in different ones. This allows for debugging of both a client and a server process at the same time, in the same JBuilder instance.
Watches, breakpoints, and classes with tracing disabled are stored per individual project. All breakpoints and watches apply to all processes in a project. Breakpoints have an option to be disabled for a runtime configuration.
To begin a new debugging session, choose one of the following options. This will debug the default configuration for the project.
Each debugging session is displayed in a separate tab at the bottom of the AppBrowser.
To end the current debugging session and release the program from memory, choose the Reset Program icon . You can also exit the program by right-clicking the debugging session tab and choosing Remove Tab. Although you will be prompted to stop the process before the tab is removed, it's a good idea to use Run|Reset Program first.
The debugger views allow you to look inside your program and see what is going on. You use debugger views to examine and change data values, trace backward and forward through your program, examine the internal processing of a method and the call to that method, and follow an individual thread in your program.
Debugger views are displayed at the bottom of the AppBrowser in the message pane. To select a view, choose its tab on the left side of the debugger. Views (except the Console output, input, and errors view) can also be displayed as floating windows. Floating windows allow you to see multiple debugger views at the same time, rather than having to switch back and forth between them. (Floating windows are a feature of JBuilder Professional and Enterprise.)
Choose a debugger view for more information:
Console output, input, and errors view
The Console output, input, and errors view displays output from the program and errors in the program. It also allows you to enter any input that the program requires. The image displayed on the icon changes if there is any output from the program or if any error messages are displayed. Runtime exceptions are displayed in this view.
Glyph | Description |
---|---|
![]() |
Output messages have been written to the view |
![]() |
Error messages have been written to the view |
![]() |
No output in the view |
Threads, call stacks, and data view
The Threads, call stacks, and data view displays the current status of the thread groups in your program. Each thread group expands to show its threads and contains a stack frame trace representing the current call sequence. Each stack frame can expand to show available data that are in scope. Glyphs visually indicate the type of data element. (Static data is not displayed in this view, but is displayed in the Loaded classes and static data view.)
The default display of this view is split into two panes. The left side of the view can expand to show stack frames. The right side displays the content of the item selected on the left, allowing the right side to show anything from a thread group to a variable. For example, if a thread is selected in the left view, the right side of the view will show the stack frames for that thread. Alternatively, if a stack frame is selected in the left view, the right view will show the variables available in that view. (This is a feature of JBuilder Professional and Enterprise.)
Glyph | Description |
---|---|
![]() |
The current stepping thread |
![]() |
A thread group |
![]() |
A blocked thread |
![]() |
A suspended thread |
![]() |
A dead thread |
![]() |
A class |
![]() |
An interface |
![]() |
An object |
![]() |
A null object |
![]() |
A method call |
![]() |
An array |
![]() |
A primitive |
![]() |
An error |
![]() |
An informational message |
This is a feature of JBuilder Enterprise.
The Synchronization monitors view shows synchronization monitors used by the threads and their current state, useful for detecting deadlocked situations.
Glyph | Description |
---|---|
![]() |
Synchronization monitor used by specified thread is not locked |
![]() |
Synchronization monitor used by specified thread is locked |
This view displays the current values of data members that you want to track. You can expand some types of watch expressions to show data elements that are in scope. Grayed-out items are inherited.
Glyph | Description |
---|---|
![]() |
A class |
![]() |
An interface |
![]() |
An object |
![]() |
A null object |
![]() |
An array |
![]() |
A primitive |
![]() |
An error |
![]() |
An informational message |
Loaded classes and static data view
The Loaded classes and static data view displays the classes currently loaded by the program. Expanding a class shows static data, if any, for that class. If a package is displayed in the tree, the number of loaded classes is displayed.
Glyph | Description |
---|---|
![]() |
A package |
![]() |
A class |
![]() |
An interface |
![]() |
A locked class |
![]() |
An object |
![]() |
A null object |
![]() |
An array |
![]() |
A primitive |
Data and code breakpoints view
The Data and code breakpoints view shows all the breakpoints set in the file and their current state. This information is available before you begin debugging from the Run|View Breakpoints command.
Glyph | Description |
---|---|
![]() |
An unverified breakpoint |
![]() |
A verified breakpoint |
![]() |
An invalid breakpoint |
![]() |
A disabled breakpoint |
![]() |
A field breakpoint |
![]() |
A breakpoint that has been disabled for a process |
Classes with tracing disabled view
This is a feature of JBuilder Professional and Enterprise.
The Classes with tracing disabled view displays an alphabetically ordered list of classes and packages not to step into. This information is available before you begin debugging from the Run|View Classes With Tracing Disabled command.
By default, when you begin a debugging session, tracing into all classes displayed in the view is disabled. This prevents the debugger from tracing into the libraries that are provided with JBuilder, allowing you to concentrate on your code, rather than on code that has already been debugged.
Glyph | Description |
---|---|
![]() |
Tracing is disabled for the selected class or package |
![]() |
Tracing is enabled for the selected class or package |
The toolbar at the bottom of the debugger provides quick access to stop, restart/resume, and pause icons, as well the Smart Step icon, the stepping icons, and the Add Breakpoints, Add Watch, and Show Current Frame icons. The toolbar also displays status messages.
The table below explains the toolbar icons:
Icon | Action | Description |
---|---|---|
![]() |
Reset Program | Ends the current application run and releases it from memory. This is the same as Run|Reset Program. |
![]() ![]() |
Restart/Resume Program | Continues the current debugging session or restarts one that has finished or been reset. This is the same as Run|Resume Program. |
![]() |
Pause Program | Pauses the current debugging session. This is the same as Run|Pause Program. |
![]() |
Smart Step | Controls whether to use the Smart Step settings in the Classes with tracing disabled view and the Smart Step options on the Debug page of the Project Properties dialog box. Smart Step is a feature of JBuilder Professional and Enterprise. |
![]() |
Step Over | Steps over the current line of code. This is the same as Run|Step Over. |
![]() |
Step Into | Steps into the current line of code. This is the same as Run|Step Into. |
![]() |
Step Out | Steps out of the current method and returns to its caller. This is the same as Run|Step Out. |
![]() |
Add Breakpoint | Adds a breakpoint to the current debugging session. Click the down-facing arrow to the right of the icon to choose the breakpoint type. This is the same as Run|Add Breakpoint. |
![]() |
Add Watch | Adds a watch to the current debugging session. This is the same as Run|Add Watch. |
![]() |
Show Current Frame | Displays the current thread's call stack. |
You can use the following shortcut keys for easy access to debugger functions:
Keys | Action |
---|---|
Shift+F9 | Debug project |
Ctrl+F2 | Reset program |
F4 | Run to cursor |
F5 | Toggle breakpoint when in editor |
F7 | Step into |
F8 | Step over |
F9 | Resume program (continues the current debug session) |
See also