Setting Conditional Breakpoints and Watchpoints

Conditional breakpoints and conditional watchpoints only break execution when a coded condition or a hit count is satisfied. You can combine both a condition and a hit count, where both must be satisfied before execution will break.

To set a conditional breakpoint or watchpoint:

  1. Set a breakpoint or watchpoint using one of the methods outlined in Using Breakpoints and Watchpoints.
  2. Right-click the breakpoint icon () or watchpoint icon () in the marker bar, and then select Breakpoint Properties.

    This opens a Properties dialog box.

  3. To add a hit count, select Hit count, click and select the required operator, and then enter the required value.
  4. To add a condition, click Condition, and then in the Conditional statement field, type your statement.
    Tip: To help you construct a condition, press Ctrl + Space to display the code assist list: a list of valid COBOL syntax and defined data items.
  5. Click Apply and Close.

    The conditional breakpoint or watchpoint is set, as indicated in the marker bar, and will in effect the next time you debug the application.

    When debugging conditional watchpoints, since execution breaks when the item has been changed, the cursor position will be on the statement after the statement that caused the data item to change value.