STEP command
The STEP
command causes z/OS® Debugger to dynamically
step through a program, executing one or more program statements.
In full-screen mode, it provides animated execution.
STEP
ends if one or more of the following conditions
is reached: - User attention interrupt
- A breakpoint is encountered
- Normal or unusual termination of the program
- a programming language or Language Environment® condition or exception
- integer
- Indicates the number of statements performed. The default value
is 1. If integer is greater than 1, the
statement is performed as if it were that many repetitions of
STEP
with the same keyword and a count of one. The speed of execution, or the pace of stepping, is set by either theSET PACE
command, or with the Pace of visual trace field on the Profile panels. *
- Specifies that the program should run until interrupted.
STEP *
is equivalent toGO
. INTO
- Steps into any called procedures or functions. This means that stepping continues within called procedures or functions.
OVER
- Steps over any procedure call or function invocations.
This operand provides full-speed execution (with no animation) while
in called procedures and functions, resuming
STEP
mode on return.If you are debugging a disassembled program, verify that you have set a breakpoint in the calling program. Without the breakpoint, z/OS Debugger cannot resume
STEP
mode on return and the application continues to run until it ends. RETURN
- Steps to the return point the specified number of levels
back, halting at the statement following the corresponding procedure
call or function invocation. This operand provides full-speed execution
(with no animation) for the remainder of the current procedure or
function, and for any called procedures or functions, resuming
STEP
mode on return.If you are debugging a LangX COBOL or disassembled program, do not use the
STEP RETURN
command because z/OS Debugger cannot identify the return point. Instead, set a breakpoint in the calling program and enter theGO
command.
Usage notes
- In the figure below,
PGM A
callsPGM B
.Assume that the current execution point is on
PGM B
and, at the lineADD 5 TO MYNUM
. At this point, you decide you don't need to see any more of the code inPGM B
. By issuingSTEP RETURN
on the command line, z/OS Debugger returns to the first line of code after theCALL
command that calledPGM B
, as indicated by the arrow. You can then continue stepping throughPGM A
. - If
STEP
is specified in a command list (for example, as the subject of anIF
command orWHEN
clause), all subsequent commands in the list are ignored. - If
STEP
is specified within the body of a loop, it causes the execution of the loop to end. - To suppress the logging of
STEP
commands, use theSET ECHO
command. - If two operands are given, they can be specified in either order.
- The animation execution timing is set by the
SET PACE
command. - The source panel provides a means of suppressing the display of selected listings or files. This gives some control of "debugging scope," because animated execution does not occur within a load module where the source listing or source file is not displayed.
- If you are debugging a disassembled program and attempt to step
out of the current CU, a message appears. The message informs you
to set a breakpoint outside the current CU. Without that breakpoint, z/OS Debugger cannot
stop the application. After you have set the breakpoint, you can resume
running your application by entering a z/OS Debugger command
like
STEP
orGO
. - If you are debugging a program that does not use the standard
linkage conventions for
R13
,R14
, andR15
, and you enter theSTEP RETURN
or theSTEP
command on a statement that returns to a higher level CU, z/OS Debugger does not stop at the expected instruction in the higher-level CU. - When
PLAYBACK ENABLE
is in effect, you can use theSTEP
command to move forward or backward one or more statements. You cannot use theINTO
,OVER
, andRETURN
keywords. EachSTEP
command moves forward or backward the number of statements specified or implied by the integer parameter. - If the
DATA
option of thePLAYBACK ENABLE
command is in effect, you can access program variables after each STEP command. - You can use the
STEP
command in remote debug mode by entering it in the Debug Console or the Action field, which is in the Optional Parameters section of the Add a Breakpoint task. - With Enterprise COBOL V5 (and later),
STEP OVER
, an out-of-line PERFORM, behaves the same as it does when stepping over a called subroutine. However, you cannot useSTEP RETURN
from within the out-of-line PERFORM to return to the statement after the PERFORM.
Examples
- Step through the next 25 statements and if an application subroutine
or function is called, continue stepping into that subroutine or function.
STEP 25 INTO;
- Step through the next 25 statements, but if any application subroutines
or functions are called, switch to full-speed execution without animation
until the subroutine or function returns.
STEP 25 OVER;
- Return at full speed through three levels of calls.
STEP 3 RETURN;