[Robelle] [SmugBook] [Index] [Prev] [Next]

System Debugger

MPE/iX has a powerful System Debugger that can display and modify data areas, set breakpoints, show hardware registers, display machine instructions, define variables, execute macros, and much more. It is a machine-level debugger, not a source-code debugger like xdb. To access the MPE debugger you :run with the ;Debug option, call the DEBUG intrinsic in your program, or set bit 13 of the Flag parameter when creating a process.

David Greer has written a good tutorial on this topic, "MPE/iX System Debugger" (Robelle, 1994).

Incidentally, HP-UX has a debugger of its very own called xdb.

Useful Debugger Commands

Text version.

abort =terminate program
b =break in program, b copy_qedit_file+$640
ba =break absolute
bd =drop breakpoints
bl =list breakpoints
bs =break in system code, bs HPFOPEN
c =continue program
cm =switch to CM mode
datab =data breakpoint
dc =dump code, dc pc,20 or dc p-20,40 (CM)
ddb =dump DB-relative, ddb+6040/2,200,s (CM)
dq =dump Q-relative, dq-20,20,# (CM)
dr =dump registers
ds =dump S-relative, ds-5,6 (CM)
dv =dump virtual, dv [sp-34],10,s
help =help on any command
macro =define macro
nm =switch to Native Mode
pb =page back in code (won)
pf =page forward in code (won)
ss =single step, update won
set croff =disable autorepeat
set cron =Return repeats last cmd
tr,d =trace, showing CM-NM switches
use =execute file of commands, use macros.pub
var =set variable (!xxx to use)
woff =windows off
won =windows on
= (equal sign) =calculator
: (colon) =MPE command


Breakpoints can be set by address or by case sensitive procedure name. Use upper case for MPE intrinsics, except TurboIMAGE and Vplus, and convert any separators in NM names to underscores (a_bc).

Text version.

b ?xxxbreaks at the start of a CM procedure (? unneeded for NM)
b xxx,-1removes a breakpoint after one occurrence
lev 1;b pc,-1sets a one-time NM return breakpoint
lev 1;b p,-1sets a one-time CM return breakpoint

NM and CM Addresses

All NM addresses byte-oriented and are often 64-bits (space.offset), while CM addresses are either 16-bit or 8-bit oriented. CM code is segment.offset, while CM data is register relative (db+100, q-10, q+10, s-5). Address indirection is indicated by square brackets:

Text version.

dp+20means "value of DP (R27) plus 20"
[dp+20]means "the value at the location whose address is the value of R27 plus 20"

Constant Values

Constants are assumed to be Hex $ in NM and Octal % in CM; decimal constants are entered with a Crosshatch #.


CM parameters are passed at Q- (dq-10,10) and stay valid as long as you are in the procedure. NM parameters are passed in registers and the stack, but their relative addresses are only fixed at initial entry.

Text version.

dr r25dumps a parameter value in register 25
dv r26,10,sdumps a character array whose address is in register 26
var buf=r26saves the address in register 26 in variable buf
dv buf,10,checks the value even if register 26 no longer contains the address

The Cseq utility shows the parameter locations for all MPE intrinsics. At Robelle we have a macro file which defines Debugger commands to dump the parameters of HPFOPEN, FOPEN and other intrinsics. We activate the macros by putting use macros.group.account in our dbuginit file.

[Robelle] [SmugBook] [Index] [RISC] [Prev] [Next]