IBM AS/400 Frozen Dessert Maker User Manual


 
Setting and Removing Breakpoints
The current thread is the thread that is currently being debugged. Debug com-
mands are issued to this thread. When a debug stop occurs, such as a breakpoint,
the current thread is set to the thread where the debug stop happened. The debug
THREAD command and the 'Work with Debugged Threads' display can be used to
change the current thread.
To remove an unconditional thread breakpoint use the CLEAR debug command.
When a thread breakpoint is cleared, it is cleared for the current thread only.
Setting and Removing Conditional Job Breakpoints
You can set or remove a conditional job breakpoint by using:
The Work with Module Breakpoints display
The BREAK debug command to set a job breakpoint
The CLEAR debug command to remove a breakpoint
Note: The relational operators supported for conditional breakpoints are <, >, =,
<=, >=, and <> (not equal).
One way you can set or remove conditional job breakpoints is through the Work
with Module Breakpoints display. You access the Work with Module Breakpoints
display from the Display Module Source display by pressing F13 (Work with module
breakpoints). The display provides you with a list of options which allow you to
either add or remove conditional and unconditional job breakpoints. An example of
the display is shown in Figure 82 on page 182.
To make the job breakpoint conditional, specify a conditional expression in the
Con-
dition
field. If the line on which you want to set a job breakpoint is not a runnable
statement, the breakpoint will be set at the next runnable statement.
| If a thread column is shown, before pressing Enter, type *JOB in the
Thread
field.
Once you have finished specifying all of the job breakpoints, you call the program.
You can use F21 (Command Line) from the Display Module Source display to call
the program object from a command line or call the program after exiting from the
display.
When a statement with a conditional job breakpoint is reached, the conditional
expression associated with the job 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 fields, set more breakpoints, and run any of the debug
commands.
An alternate method of setting and removing conditional breakpoints is to use the
BREAK and CLEAR debug commands.
To set a conditional breakpoint using the BREAK debug command, type:
BREAK line-number WHEN expression
on the debug command line. The variable
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
Chapter 11. Debugging Programs 181