Debugging applications

The debug view in App Builder enables you to set breakpoints and step through Java™ and Groovy code while viewing local variables, thread status, and stack frames.

See a flash video tutorial of the debugger and its accompanying transcript.

Using the Debug view

Click the Debug tab, as shown in the following screen capture, to start debugging an application.

Screen capture of the Debug tab.

Applications are always run in debug mode when using the App Builder, so just click the Run icon to start your application as you normally would. If your application was already started from the CLI, it will need to be restarted from the App Builder before debugging.

Setting breakpoints

Breakpoints can be set on executable lines of code. This does not include method signatures or variable declarations. To set breakpoints in the application, use one of the following options:

  • Double-click the left column of the code viewer next to the line number.
  • Right-click and select Set Breakpoint as shown in the following screen capture:

    Screen capture of the setting breakpoint.


After you set the breakpoint, a red ball icon is displayed next to the line. You can also view the breakpoint in the Breakpoints tab, that lists all breakpoints and allows you to enable and disable them as shown in the following screen capture:

Screen capture of the Breakpoints tab.

To clear the breakpoint, double-click the red breakpoint icon or right-click and select Clear breakpoint.

When a breakpoint is hit, the source for the current line is loaded in the code viewer. The current line is marked by a yellow arrow cursor to the right and the line is highlighted in light blue as shown in the following screen capture:

Screen capture of the the current line after a breakpoint has hit.

Variables and threads views

As seen in the following screen capture, you can view the local variables in the Variables tab in the top-right and the threads in the bottom-right pane.

Screen capture of local variables and threads views.

Threads that are suspended can be expanded to see the stack.

Using the control buttons

At the top of the code viewer are the buttons as shown in the following screen capture:

Screen capture of debug buttons.

Starting from the left, the buttons are described in the following list:

Resume
Resumes the selected thread.
Step Over
Steps over the current line.
Step Into
Steps into the current line (if there is a function call).
Step Out
Steps out of the current function.
Refresh
Refreshes the debugger display with the target application.

Version 2.0.30111