How to Debug [ System Debug Reference Manual ] MPE/iX 5.0 Documentation
System Debug Reference Manual
How to Debug
This chapter gives a very brief introduction to debugging. For
additional information, refer to the Programmer's Guide corresponding to
the language compiler you are using. There you will find details and
examples specific to your language.
How to Debug a CM Program
Compile and, using the Segmenter, prepare your program file and optional
library files.
In order to take full advantage of Debug's symbolic capabilities, you
must ensure that your program (and library) contain the necessary FPMAP
symbolic records. This is easily accomplished with the Segmenter as
follows:
For program files, use the FPMAP option when you prepare your program:
:PREP USLFILE, PROGFILE;FPMAP
For libraries, use the FPMAP option each time you add a segment to the
library:
ADDSL SEG ; FPMAP
To debug your program, specify the Debug parameter in the RUN command:
:RUN CMPROG.GRP.ACCT;LIB=G;DEBUG
The program file is loaded, and you break at the first instruction in
your program, at the main entry point.
Debug announces your arrival into the debugger. You are now ready to
debug your program. Set breakpoints, define macros, turn on the windows,
and so on. For example,
:RUN CMPROG.GRP.ACCT;LIB=G;DEBUG
CM DEBUG Intrinsic: PROG %0.22
%cmdebug > won
How to Debug an NM Program
Compile and link your program file and any necessary libraries.
To Debug your program, specify the DEBUG parameter in the RUN command:
:RUN NMPROG;DEBUG
The NM program file is loaded, and a temporary breakpoint is set at the
external stub that is linked to your program's main entry point.
When the program is launched into execution, the temporary breakpoint is
hit, and you immediately enter Debug (in NM mode). Debug announces your
arrival and deletes the temporary breakpoint.
To best observe the actual entrance (through the stub procedure) into
your main program, type WON to turn the windows on. Note that you are at
a stub procedure, which is marked with a question mark:
> ?PROGRAM
?PROGRAM+0004 etc.
Single step a few times to advance the program through the stub and into
the main body of the program. In summary,
:RUN NMPROG;DEBUG
Break at: [0] PROG 31.00022e7c ?PROGRAM
$nmdebug > won
$nmdebug > s
$nmdebug > s
You are now ready to debug your program. Set breakpoints, define macros,
turn on the windows, and so forth.
MPE/iX 5.0 Documentation