Use the Work with Breakpoints display

You can use the Work with Breakpoints display to set or remove breakpoints.

Note: The relational operators supported for conditional breakpoints are <, >, =, <=, >=, and <> (not equal).

The Work with Module Breakpoints display can be accessed from the Display Module Source display by pressing F13 (Work with Module Breakpoints). The Work with Module Breakpoints display is shown in the figure below. To set a conditional breakpoint, type the following and press Enter:

For example, to set a conditional breakpoint at debugger line 35, as shown in the figure below, type the following and press Enter:

To remove a conditional breakpoint, type 4 (Clear) in the Opt field next to the breakpoint you want to remove, and press Enter. You can also remove unconditional breakpoints in this manner.

Figure 1. Set a Conditional Breakpoint
                         Work with Module Breakpoints
                                                             System:   SYSTEM01
 Program  . . . :   MYPGM                Library  . . . :   MYLIB
   Module . . . :     MYMOD              Type . . . . . :   *PGM
 
 Type options, press Enter.
   1=Add   4=Clear
 
 Opt     Line       Condition
  1      35____     &I=21______________________
  _      ______     ____________________________

Repeat the previous steps for each conditional breakpoint you want to set or remove.

Note: If the line on which you want to set a breakpoint is not a runnable statement, the breakpoint is set at the next runnable statement.

After you specify all breakpoints that you want to set or remove, press F3 (Exit) to return to the Display Module Source display.

Then press F3 (Exit) to leave the Display Module Source display. You can also use F21 (Command Line) from the Display Module Source display to call the program object from a command line.

Call the program object. When a statement with a conditional breakpoint is reached, the conditional expression associated with the breakpoint is evaluated before the statement is run. If the result is false, the program object continues to run. If the result is true, the program object stops, and the Display Module Source display is shown. At this point, you can evaluate variables, set more breakpoints, and run any of the debug commands.