ILE COBOL Programmer's Guide

Setting and Removing Conditional Job Breakpoints

You can set or remove a conditional job breakpoint by using:

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

One way you can set or remove conditional job breakpoints is through the Work with Module Breakpoints display. 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 Figure 38.

Setting

You can set conditional job breakpoints using the Work with Module Breakpoints display or using the BREAK debug command.

To set a conditional job breakpoint using the Work with Module Breakpoints display:

  1. Type 1 (Add) in the Opt field.
  2. Type the debugger line number, to which you want to set the breakpoint, in the Line field.
  3. Type an conditional expression in the Condition field.
  4. If a thread column is shown, before pressing Enter, type *JOB in the Thread field.
  5. Press Enter.

Figure 38. Setting a Conditional Breakpoint

+--------------------------------------------------------------------------------+
|                              Work with Module Breakpoints                      |
|                                                         System:   ISERIES      |
| Program  . . . :   TEST                 Library  . . . :   TESTLIB             |
|   Module . . . :     SAMPMDF            Type . . . . . :   *PGM                |
| Type options, press Enter.                                                     |
|   1=Add   4=Clear                                                              |
| Opt     Line       Condition                                                   |
|  1      35____     I=21________________________                                |
|  _      ______     ____________________________                                |
+--------------------------------------------------------------------------------+

If the line on which you want to set a breakpoint has multiple statements, the breakpoint is set at the first statement on the line.

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

Once you have finished specifying all of the breakpoints that you want to set or remove, press F3 (Exit) to return to the Display Module Source display.

Then press F3 (End Program) 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.

Run the program object or service program. When a statement with a conditional job 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.

To set a conditional job breakpoint using the BREAK debug command, type:

BREAK line-number WHEN expression

on the debug command line. line-number is the line number in the currently displayed view of the module object on which you want to set a breakpoint and expression is the conditional expression that is evaluated when the breakpoint is encountered. The conditional expression can only be a simple expression. The term on the right hand side of the equation can only contain a single value. For example, I=21 is accepted but I=A+2 or I=3*2 are not accepted.

If the line on which you want to set a breakpoint has multiple statements, the BREAK debug command will set the breakpoint at the first statement on the line.

Example

For example, to set a conditional job breakpoint at debugger line 35:

  1. Type 1 (Add) in the Opt field.
  2. Type 35 in the Line field.
  3. Type I=21 in the Condition field, and press Enter as shown in Figure 38. (If a thread column is shown, before pressing Enter, type *JOB in the Thread field.)
  4. Repeat the previous steps for each conditional job breakpoint you want to set.

Removing

You can remove conditional job breakpoints using the Work with Module Breakpoints display or using the CLEAR debug command.

To remove a conditional job breakpoint using the Work with Module Breakpoints Display, type 4 (Clear) in the Opt next to the breakpoint you want to remove, and press Enter. You can also remove unconditional breakpoints in this manner. Figure 38 shows a typical display where 4 (Clear) could be entered in the Opt field.

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

To remove a conditional job breakpoint using the CLEAR debug command, type:

CLEAR line-number

on the debug command line. line-number is line number in the currently displayed view of the module object from which you want to remove a job breakpoint.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]