DEBUG Subcommands Section 4. DEBUG Subcommands· This section describes the subcommands that
vou use the debug environment to test and debug environment is entered when:
are available to you when debug your programs. The The DEBUG command is issued from the CKS environment.
command is described in "Section 2. CMS Commands.")
(The DEBUG e An e[ternal interruption occurs.
by the CP ElTERN!L command.) (An external interruption is caused A breakpoint (instruction address encountered during program execution. (Breakpoints are set with the DEBUG Sllbcommand BREAK.) When the debug environment is entered, the contents of all general registers, the channel status word (CSW), and the channel address word (CAW) are saved so they may be examined and changed before being
restored when leaving the debug environment. If debug is entered via an
interruption, the old program status word (PSi) for that interruption is
also saved. If DEBUG is the first command entered after an abnormal
termination (abend) occurs, the contents of all general registers, the CSi, the CAW, and the old PSW are available from the time of the abend.
For hints on debugging your programs using the CMS debug environment,
consult the Guide.
Section 4. DEBUG Subcommands 263
DEBUG Subcommands-BREAK
BREAK Use the BREAK subcommand to stop execution of a program or module at a
specific instruction location called a breakpoint. The format of the
BREAK subcommand is:
r --------, I BReak id {SymbOl} hexloc , 1 , L- id
symbol
hexloc
is a decimal number, from 0 to 15, which identifies the
breakpoint. A maximum of 16 breakpoints may be in effect at
one time; if you specify an identification number that is
already set for a breakpoint, the previous breakpoint is
cleared and the new one is set.
is a name assigned to the storage location where the
breakpoint is set. symbol, if used, must have previously been
set using the DEFINE subcommand.
is the hexadecimal storage location (relative to the current
origin) where the breakpoint is to occur. hexloc must be on a
halfword boundary and its value added to the current origin
must not exceed your virtual machine size.
1. To set breakpoints before beginning program execution, enter the
debug environment with the DEBUG command after you load the program
into storage. After setting the breakpoints, use the RETURN subcommand to leave the debug environment and issue the START command to begin program execution. For example:
load myprog
debug
break 1 20016 break 2 20032 return
start
2. When you assign hexloc to a breakpoint, you must know the current
origin (set with the ORIGIN subcommand). The hexloc you specify is added to the current origin to determine the breakpoint address.
3. When a breakpoint is found during program execution, the message:
DMSDBG728I DEBUG ENTERED BREAKPOINT yy AT xxxxxx
is displayed at the terminal. To resume program execution, use the GO subcommand.
4. Breakpoints are cleared after they are encountered; thus, if a
breakpoint is encountered during a program loop you must reset the
breakpoint if you want to interrupt execution the next time that
address is encountered.
5. When vou set a breakpoint, the halfword at the address specified is
replaced with B2Ex, where x represents the identification number
you assigned. After the breakpoint is encountered during eX9cution, B2Ex is replaced with the original operation code.
264 VM/370 Command Macro Reference
Previous Page Next Page