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 DevX Code 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 DevX Code 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.

    Important

    If you do not need a WHEN condition that is already added, then BMC recommends that you should delete that WHEN condition and add a new one.

    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

  1. Start a debug session
  2. In the command palette, type Workbench Debug: Set Breakpoints in a Program.
  3. 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, it will show an error message.




 

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