Setting a breakpoint
In z/OS® Debugger, breakpoints can indicate a stopping point in your program and a stopping point in time. Breakpoints can also contain activities, such as instructions to run, calculations to perform, and changes to make.
A basic breakpoint indicates a stopping point in your program.
For example, to stop on line 100 of your program, enter the following
command on the command line:
AT 100
In the
Log window, the message AT 100 ;
appears. If line
100 is not a valid place to set a breakpoint, the Log window displays
a message similar to Statement 100 is not valid
.
The breakpoint is also indicated in the Source window by a reversing
of the colors in the prefix area.Breakpoints do more than just indicate a place to stop. Breakpoints
can also contain instructions. For example, the following breakpoint
instructs z/OS Debugger to
display the contents of the variable myvar when z/OS Debugger reaches
line 100:
AT 100 LIST myvar;
A breakpoint can contain instructions that alter the flow of the
program. For example, the following breakpoint instructs z/OS Debugger to go
to label
newPlace
when it reaches line 100: AT 100 GOTO newPlace ;
A breakpoint can contain a condition, which means that z/OS Debugger stops
at the breakpoint only if the condition is met. For example,
to stop at line 100 only when the value of myvar is
greater than 10, enter the following command:
AT 100 WHEN myvar > 10;
A breakpoint can contain complex instructions. In the following
example, when z/OS Debugger reaches
line 100, it alters the contents of the variable myvar if
the value of the variable mybool is true:
AT 100 if (mybool == TRUE) myvar = 10 ;
The
syntax of the complex instruction depends on the program language
that you are debugging. The previous example assumes that you are
debugging a C program. If you are debugging a COBOL program, the same
example is written as follows: AT 100 if mybool = TRUE THEN myvar = 10 ; END-IF ;
Refer to the following topics for more information related to the material discussed in this topic.
- Related references
- IBM® z/OS Debugger Reference and Messages