A breakpoint suspends the
execution of a model at the location where the breakpoint is set.
Breakpoints can be enabled and disabled via the context menu in the Breakpoints
view, or via the context menu in the code editor ruler.
A disabled
breakpoint will not cause model to suspend. Disabled breakpoints
are drawn with a white circle [].
Breakpoints are displayed in the vertical editor ruler and in the Breakpoints view.
The Breakpoints view lists
all the breakpoints currently set in your workspace.
You can double-click a breakpoint to display its location in the editor
(if applicable). You can also enable
or disable breakpoints, delete
them, add new ones, or set hit counts.
The Breakpoints view
To show/hide the
Breakpoints view
Choose View > Breakpoints from the main menu.
The Breakpoints view provides a set of toolbar buttons enabling the user to manage the breakpoints listed in the view:
Command |
Action |
|
Removes the selected breakpoint. |
|
Removes all breakpoints from the view. |
|
Toggles the view to show all breakpoints or only breakpoints supported by current target. |
|
Opens the Java editor and selects there the line that
corresponds to the selected breakpoint. |
|
Sets all breakpoints to be skipped. |
|
Expands all items in the view. |
|
Collapses all items in the view. |
|
Toggles the view contents to be synced with the Debug view. |
|
Opens the Add Java Exception Breakpoint dialog, which allows to create exception breakpoints. Thread execution can be suspended at locations where the exception is uncaught, caught, or both. |
Breakpoints are set on an executable line of a model.
To add a breakpoint
In
the code editor, directly to the left of the line where you want to add
the breakpoint, right-click (Mac OS: Ctrl click) the marker bar
(vertical ruler) and select Toggle
Breakpoint from the popup menu. You can also double-click on the
marker bar - this action also toggles a breakpoint. In the Properties view, the same actions
are applicable, but first you have to place the cursor in the
corresponding code field.
Also, the new breakpoint appears in the Breakpoints view list.
While the breakpoint is enabled, model thread execution suspends before that line of code is executed. The debugger selects the thread that has suspended and displays the thread's stack frames. The line where the breakpoint was set is highlighted in the code editor.
Breakpoints can be easily removed when you no longer need them.
To remove a breakpoint
In the Properties view or in the code editor, directly to the left of the line where you want to remove the breakpoint, right-click (Mac OS: Ctrl click) the marker bar (vertical ruler) and select Toggle Breakpoint from the popup menu. The breakpoint is removed from the workbench. You can also double-click directly on the breakpoint icon to remove it.
Breakpoints can also be removed in the Breakpoints view. Select the breakpoint to be removed and from the context menu select Remove Breakpoint. The breakpoint selected in the Breakpoints view can be also removed using the Remove Breakpoint toolbar button of this view,
If you find yourself frequently adding and removing a breakpoint in the same place, consider disabling the breakpoint when you don't need it and enabling it when needed again.
Breakpoints can be enabled and disabled as needed.
When a breakpoint is enabled, thread execution suspends before that line of code is executed. The debugger selects the thread that has suspended and displays the thread's stack frames. The line where the breakpoint was set is highlighted in the code editor.
When a breakpoint is disabled, thread execution is not suspended by
the presence of the breakpoint.
To disable a breakpoint
In the Properties view, click into the line where the breakpoint is set.
Press Ctrl J (Mac OS: Cmd J) to open code editor. The code editor will be opened with the line of code corresponding to the one selected in the Properties highlighted.
Right-click (Mac OS: Ctrl click) the breakpoint you want to
disable in the marker bar (vertical ruler) and select Disable Breakpoint from the popup
menu. The breakpoint image will change to a white circle and its
checkbox in the Breakpoints view will be empty.
To enable a breakpoint
In the Properties view, click into the line where the breakpoint is set.
Press Ctrl J (Mac OS: Cmd J) to open code editor. The code editor will be opened with the line of code corresponding to the one selected in the Properties highlighted.
Right-click (Mac OS: Ctrl click) the breakpoint you want to
enable in the marker bar (vertical ruler) and select Enable Breakpoint from the popup
menu. The breakpoint image will change to a blue circle and its
checkbox in the Breakpoints view will be checked.
A hit count can be applied to breakpoints. When a hit count is applied to a breakpoint, the breakpoint suspends execution of a thread the nth time it is hit, but never again, until it is re-enabled or the hit count is changed or disabled.
To set a hit count on
a breakpoint
An enabling condition
can be applied to a breakpoint such that the breakpoint suspends
execution of a thread in one of these cases:
To set a condition on a breakpoint