The DISPLAY command also displays the PSW, CAW, and CSi: cp display psw
cp display caw
cp display csw iith the STORE command, you can change the contents of registers,
storage areas, or the PSi. As you can see, the CMS DEBUG subcommands and the CP commands ADSTOP, DISPLAY, and STORE, have many duplicate functions. The environment you
choose to work in, CP or debug, is a matter of personal preference. The
differences are summarized in Figure 18. What you should be aware of,
however, is that you should never attempt to use a combination of CP commands and DEBUG subcommands when you are debugging a program. Since DEBUG itself is a program, when it is running (that is, when you are in
the debug environment), the registers that CP recognizes as your virtual
machine's registers are actually the registers being used by DEBUG. DEBUG saves your program's registers and PSW and keeps them in a special
save area. Therefore, if you enter the DEBUG and CP commands to display
registers, you will see that the register contents are different:
gpr 0 15 tcp d g DEBUGGING WITH CP AFTER A PROGRAM CHECK When a program that is executing under CMS abends because of a program
check, the DEBUG routine is in control and saves your program's
registers, so that if you want to begin debugging, you must use the DEBUG command to enter the debug environment. You can prevent DEBUG from gaining
interruption occurs by turning on the wait
(location X'68' in low storage):
cp store 68 00020000 control when a
bit in the program program
new PSW You should do this before you begin executing your program. Then, if a
program check occurs during execution, when CP tries to load the prograB new PSi, the wait bit forces CP into a disabled wait state and you
receive the message: DMKDSP450W CP ENTERED; DISABLED WAIT PSi All of your program's registers and storage areas remain exactly as they
were when program interruption occurred. The PSi that was in effect
when your program was interrupted is in the program old PSi, at location X'28'. Use the DISPLAY command to examine its contents:
cp display 28.8
The program new PSW, or the PSi you see if you enter the command DISPLAY PSW, contains the address of the DEBUG routine.
If, after using CP to examine your registers and storage areas, you
can recover from the problem, you must use the STORE command to restore
the PSi, specifying the address of the instruction just before the one
indicated at location X'28',. For example, if the instruction address in
your program is X'566' enter: 220 IBM VM/370 CMS User's Guide
Oaqe of GC20-1819-2 As Updated April 1, 1981 by TNL GN25-0826 cp store nsw 0 20566 cp beqin
In this example, settinq the first word of the PSi to 0 turns the wait bit so that execution can resume.
Program Dumps When a proqram you execute under CMS abnormally terminates, you do not
automatically receive a program dump. If, after attempting to use :MS and CP debuo interactively, you still have not discovered the
problem, yOJ may want to obtain a dumn. You might also want to obtain a
dump i& you Find that you are displaying larqe amounts of information,
which is not nractical on a terminal. Deoending on whether you are using eMS DEBUG or :P to do your
debugqinq, yoa can use the DUMP command to specify storage locations you
want nrinted. The formats of the DUMP command (CP) and the DUMP subcommand (DEBUG) are a little different. See Macro Reference for a discussion of the DEBUG subcommand, DUMP; see for for a discussion of the CP DU?1P command.
In either event, vou can selectively dump portions of your virtual storaqe, VOlr entire virtual storaqe area, or portions of real storage.
For example, in the debuq environment, to dump the virtual storage space
that contains your proqram, you would enter: dU1lp 20000 208iO The seconj value depends upon the size of your program.
From the CP environment, enter:
cp dump t20000-20810 CP command allows you to request EBCDIC translation hexadecimal dump. The dump produced by the DEBUG subcommand provide EBCDIC translation.
Debugging rvlodules with the
does not
You can debuq nonrelocatable MODULE files (created with the GENMOD command) in the same way you can debug object modules (TEXT files).
To load the MODULE into storage, use the LOADMOD command:
loadmod mymod
cp adstop 201CO start You can generate a new module containing any changes that you make to a in ,oar storage only if your module file includes a load
map. When you issue the GENMOD command, the changes become a permanent
part of the executable module:
loadmod mvmod
cp store 201CO 0002 qenmod mymod
To debug files in this manner, you must have a listing of the
proqram as it existed when the module was created.
section 11. How VM/370 Can Help You Debug Your Programs 221
Previous Page Next Page