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.

    image2022-8-1_21-41-6.png

  • 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

  1. Start a debug session.
  2. Right-click on the vertical ruler of the source display for which you want to set the breakpoint and click Add Conditional Breakpoint.

    image2022-8-1_21-59-34.png

    Or

    Alternatively, select the line on which you want to add a breakpoint, and click Run > New Breakpoint > Conditional Breakpoint.

    image2022-8-1_21-55-20.png

  3.  Enter the required Expression, and press Enter.

    image2022-8-1_22-0-52.png

    Important

    • On the BREAKPOINTS panel, hover over the breakpoint to see the breakpoint details.
    • If the condition is true, the Workbench Debug stops on this line.
    • You can also edit the conditional breakpoint by right-clicking on the breakpoint and selecting Edit Condition.

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

  1. Start a debug session.
  2. On the BREAKPOINTS panel, click in the debug view.
  3. In Function to break on, enter the valid WHEN condition.

    image2022-9-6_13-21-15.png
    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

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*