HP 3000 Manuals

INTRODUCTION TO DEBUG AND STACKDUMP [ MPE Debug/Stack Dump Reference Manual ] MPE/iX 5.0 Documentation


MPE Debug/Stack Dump Reference Manual

Chapter 1  INTRODUCTION TO DEBUG AND STACKDUMP 

DEBUG 

DEBUG is an intrinsic procedure which provides both non-privileged and
privileged users with an interactive debugging facility to enable
checkout of their operating environments.

Non-privileged users are bound by software protection checks to their
private code segment domains and (stack) data space.  For privileged
users the only bounds checking performed is that for stack overflow
(where the S register contains an address greater than that in the Z
register).


WARNING The normal checks and limitations that apply to the stan- dard users in MPE are bypassed in privileged mode. It is possible for a privileged mode program to destroy system integrity, including the MPE operating system software it- self. Hewlett-Packard cannot be responsible for system in- tegrity when programs written by users operate in privileged mode.
With DEBUG, it is possible to: * Establish one or more breakpoints in a program. The program will execute until a breakpoint is reached, then stop and pass control to the user. * Display and/or modify the contents of memory locations relative to the data stack bases DB, DL, Q, and S. * Display the contents of memory locations relative to the code bases PB, P, or PL. * Display and/or modify the contents of registers. * Trace and display stack markers. * Calculate the value of expressions in order to determine the correct values for variables at a given point in a program. * Redirect displays to a list device. * In addition, privileged users only can: Display and/or modify absolute data segments Display code segments and disc sectors Freeze (and subsequently unfreeze) code or data segments in memory. DEBUG can be invoked by a direct external call to the DEBUG intrinsic, or by specifying the DEBUG parameter in the :PREPRUN or :RUN commands or the CREATE intrinsic.
NOTE See the MPE Commands Reference Manual for a discussion of the :PREPRUN and :RUN commands and the MPE Intrinsics Reference Manual for a discussion of the CREATE intrinsic.
Once the DEBUG facility is accessed, control is passed to the user at the interactive terminal so the user can establish breakpoints in his program. The program executes until a breakpoint is reached, then DEBUG is called again and control is again passed to the user. It is important to note that when DEBUG is called, the scope of access is determined solely by the capa- bility (non-privileged or privileged) of the user and not of the calling program. Upon entry to DEBUG, validity checks ensure that the user is in an interactive session and has read/write access to the program file. If not, control is returned immediately to the user. Hence, a DEBUG intrinsic call in a program running in batch mode is essentially regarded as a null statement and DEBUG is not executed. Four temporary registers, known as registers 1, 2, 3, and 4, are provided by DEBUG for the conve- nience of the user. Each register is set to zero upon entry to DEBUG. These registers can be displayed or modified in the same way as normal system registers and thus may be used to store values that are used repeatedly in debugging a program. See Section III for a description of how to use DEBUG.


MPE/iX 5.0 Documentation