operands of the SET command are set ON; the EMSG operand is set to TEXT;
and the SMSG operand is set OFF. To verify these settings, use the QUERY SET
command.
Commands to Collect and AIlaiyze Systeln Infonnatioll This section discusses six commands to collect and analyze system information
when you are debugging. These are the ADSTOP and BEGIN commands and the
LOCATE, MONITOR, PER, and TRACE commands.
Stopping Virtual' Machine Execution at a Specific Address
The ADSTOP command stops the execution of a virtual machine at a specific
address; BEGIN causes the virtual machine to resume execution.
Execution halts when the instruction at the address specified in the ADSTOP command is reached. At this point, you may invoke other CP debugging com­
mands.
The address stop should be set after the program is loaded but before it executes.
When the specified location is reached during program execution, execution halts
and the CP command environment is entered. You may then enter other CP com­
mands to examine and alter the status of the program.
Set an address stop at a location where you suspect the error in the program. You
can then display the registers, control words, and data areas to check the program
at that point in its execution. This procedure helps you locate program errors. You
may be able to alter the contents of storage in such a way that the program will
execute correctly. You can then correct the error you have detected and, if neces­
sary, compile and execute the program again.
To successfully set an address stop, the virtual instruction address must be in real
storage at the time the ADSTOP command is issued.
The RANGE keyword of the CP PER command can be used to set multiple
address stops. However, unlike the CP ADSTOP command, the program execution
halts after the execution of the instruction at the given address. Note also that
address stops set using the PER command remain in effect until you turn off the
trace element set up by the PER command. There is no need for the program to
already be in storage before setting address stops with the CP PER command.
Setting up mUltiple address stops with PER is accomplished by using RANGE as an
option to the INSTRUCT keyword. The instruction-addr-range, in this case, is a
single value corresponding to the address of the instruction where program exe­
cution is to be halted.
For example, PER INSTRUCT RANGE 20000 causes program execution to halt after the instruction at location 20000 executes. PER INSTRUCT RANGE 20000 RANGE 20400 causes a program to halt after an instruction at either location 20000 or 20400 exe­
cutes.
Introduction to Debugging 499
Note: Although output is produced only after the instruction at 20000 or 20400 executes, the hardware causes a PER interrupt for every instruction executed in the
range 20000 to 20400. This may degrade the performance of the virtual machine.
Locating CP Control Blocks in Storage Use the LOCATE command to find the address of CP control blocks associated
with a particular user, a user's device, or a real system device. The control blocks
and their functions are described in the VM / SP Data Areas and Control Block Log­
ic, Volume 1. Once you know the location of the control blocks, you can examine the block you
want to look at. When you want to examine specific control blocks, use the LOCATE and the DCP command to display or the DMCP command to print the
control blocks. A discussion of the most important fields of the VMBLOK, VCUBLOK, VDEVBLOK, RCHBLOK, RCUBLOK, and RDEVBLOK are
included in "Reading CP Abend Dumps." Commands that Trace Events in Virtual Machines Use the TRACE command to trace the following virtual machine events: SVC interruption I/O interruption Program interruption
External interruption Non-I/O privileged instructions SIO, SIOF, TIO, CLRIO, HIO, HDV, and TCH instructions.
Branch instructions
CCW and CSW instructions
The results collected by the TRACE command are spooled to your virtual printer
and to your terminal and/or real printer. Use the PER command to selectively trace the execution of the instructions that
cause specific events. The specific events that can be traced are: Successful branches
The fetching and execution of instructions The execution of instructions in the virtual machine that alter storage
The execution of instructions that alter general purpose registers.
The trace output produced by the PER command can be recorded on the terminal,
the virtual printer, or on both the terminal and the printer.
Commands that Alter the Contents of Storage You can use the STORE, STCP, and ZAP commands to alter the contents of stor­
age.
Altering the Contents of Virtual Machine Storage Use the STORE command to alter the contents of specified registers and locations
in virtual machine storage. The contents of the following can be altered: 500 VM/SP System Programmer's Guide
Virtual machine storage locations (first-level virtual storage only)
General registers
Floating-point registers
Previous Page Next Page