Tbere are several things you can do to control tbe amount of information
you receive when you are using the TRACE command, and how it is
received. For example, if you do not want program execution to baIt every time a trace output message is issued, you can use the RUN option:
cp trace svc run
Tben, you can baIt execution by pressing the Attention key when tbe
interruption you are waiting for occurs. You sbould use tbis option if
you do not want to baIt execution at all, but merely want to watcb what
is happening in your program. Similarly, if you do not require your trace output immediately, you
can specify that it be directed to the printer, so that your terminal
does not receive any information at all:
cp trace inst printer Wben you direct trace output to a
with any printed program output.
from otber printed output, use the
printer at a virtual address lower example: cp define printer 006 printer, the trace output is mixed in
If you want trace output separated CP DEFINE command to define a second
than that of your printer at OOE. For
Tben, trace output will be in a separate spool file. printed output
always goes to tbe printer at address OOE. Wben you finish tracing, use the CP CLOSE command to close tbe
virtual printer file:
cp close e
-- or --
cp close 006 If you want trace output at the printer and at tbe terminal, you can use
tbe BOTH option:
cp trace all both
If you are debugging a program that does a lot of I/O, or tbat issues many SVCs, and you are tracing instructions or branches, you migbt net
wish to bave tracing in effect when tbe supervisor or I/O routine has
control. Wben you notice that addresses being traced are not in your
program, you can enter:
cp trace end
and tben set an address stop at the location in your program that
receives control when the supervisor or I/O routine has completed:
cp adstop 20688 begin
218 IBM VM/370 eMS User's Guide
Then, when this address is encountered, you can re-enter the CP TRACE
command. USING THE SVCTRACE If your program issues many SVCs, you may not get all of the information
you need using the CP TRACE command. The SVCTRACE command is a CMS command, which provides more detailed information about all SVCs in your
program, including register contents before and after the SVC, the name
of the called routine, and the location from which it was called, and
the contents of the parameter list passed to the SVC. The SVCTRACE command has only two operands, ON and OFF, to begin and
end tracing. SVCTRACE information can be directed only to the printer,
so you do not receive trace information at the terminal.
Since the SVCTRACE command can only be entered from the CMS environment, you must use the I.mediate commands SO (suspend tracing) or HO (halt tracing) if you want tracing to stop while a program is
executing. Use the Immediate command RO to resume tracing.
Since the CMS system is "SVC-driven", this debugging technique can be useful. especiallY8 when you are debugging CMS programs. For more
information on writing programs to execute in CMS, see "Section 13.
Programming for the CMS Environment."
Using CP Debugging Commands
In addition to the CMS debugging facilities, there are CP commands that
you can use to debug your programs. These commands are: • DISPLAY, which you can use to examine virtual storage, registers, or
control words, like the PSW • ADSTOP. which you can use to set an instruction a.ddress stop in your
program • STORE, which you can use to change the contents of a storage
location, register, or control word When you use the display command, you can request an EECDIC translation
of the display by prefacing the location you want displayed with a "T":
cp display t20000.10 This command requests a display of X'10' (16) bytes beginning at
location X'20000'. The display is formatted four words to a line, with
EBCDIC translation at the left, much as you would see it in a dump. You can
registers.
also use the DISPLAY command
For example, the commands:
cp display g
cp display g1
cp display g2-5
to examine the general
result in displays of all the general registers, of general register 1,
and of a range of registers 2 through 5.
Section 11. How VM/310 Can Help You Debug Your programs 219
Previous Page Next Page