Setting breakpoints
When a debug session is launched, you can set a conditional breakpoint on the executable statement.
To add or remove breakpoints
Perform one of the following steps to add or remove breakpoints:
- Right-click the vertical ruler of a source display, and select Add Breakpoint.
- Click the vertical ruler next to a line.
The Breakpoints view shows all breakpoints that currently exist in the debug session.
Conditional breakpoint
Conditional breakpoints stop the run only after a specified condition is met. Upon encountering a source line designated with a conditional breakpoint, the Workbench Debug evaluates whether the associated condition is true. If true, the breakpoint is honored and the run stops at that source line.
If false, the breakpoint is ignored and the run continues.
To define a conditional breakpoint
- Start a debug session.
- Right-click on the vertical ruler of the source display for which you want to set the breakpoint and click Add Conditional Breakpoint.
Or
Alternatively, select the line on which you want to add a breakpoint, and click Run > New Breakpoint > Conditional Breakpoint. Enter the required Expression, and press Enter.
WHEN conditions breakpoint
Unlike conditional breakpoints, WHEN conditions are not associated with a particular source line. Source statements in WHEN conditions run one at a time. Every defined WHEN condition expression is evaluated after each source statement is run. Although multiple WHEN conditions can be active simultaneously, they are evaluated in the order in which they were defined. After a defined WHEN condition is satisfied (evaluates to true), program execution halts, positioned at the last executed source statement.
To set WHEN conditions breakpoint
- Start a debug session.
- On the BREAKPOINTS panel, click + in the debug view.
In Function to break on, enter the valid WHEN condition.
The WHEN condition consists of a variable, an operator, and a comparison value. The breakpoint is applied where the condition is met in code execution.The following table describes the basic set of operators:
Operator
Meaning
<
Less than
=
Equal to
>
Greater than
NOT
Logical negation
Setting breakpoints in a program
The Workbench Debug: Set Breakpoints in a Program command allows you to open DDIO programs and set breakpoints during a debug session. Upon launching a debug session, the loaded script view is populated with the load module specified in the launch configuration used.
To set breakpoints in a program
- Start a debug session
- In the command palette, type Workbench Debug: Set Breakpoints in a Program.
- Enter the module name. If the module's source is available then the module is added to the LOADED SCRIPT view. When you click on the module name the source is opened in the editor view and you can set breakpoints into it. if the module source is not available then it will show an error message.