HP 3000 Manuals

USING DEBUG WITH STANDARD CAPABILITY [ MPE Debug/Stack Dump Reference Manual ] MPE/iX 5.0 Documentation


MPE Debug/Stack Dump Reference Manual

USING DEBUG WITH STANDARD CAPABILITY 

Figure 3-3 shows a sample execution of program DBTESTI (program file
DBPROG1) using DEBUG commands to establish breakpoints, display values
and registers, and modify values and registers.  This run illustrates use
of DEBUG commands with the standard capability.  (Use of the DEBUG
intrinsic is illustrated in Figure 3-8.  Use of DEBUG with privileged
mode capability is discussed later in this section, The stack dump
facility is discussed in section IV.)

If you want to debug a compiled and prepared program, you specify the
DEBUG parameter in the :RUN command as follows:

     :RUN program file name; DEBUG

The program file prepared in Figure 3-2 is named DBPROG1.  To run this
program in DEBUG mode, enter:

     :RUN DBPROG1;DEBUG 

If the program has only been compiled but not prepared, you may include
DEBUG in a :PREPRUN command to prepare and execute in DEBUG mode.  Since
you will probably need a map, include the PMAP parameter as follows:

     :PREPRUN USL file name; DEBUG;PMAP

Or, assuming the program DBTEST1 has just been compiled:

     :PREPRUN $OLDPASS;DEBUG;PMAP

Since both DEBUG and PMAP are keyword parameters, they can be entered in
any order after the file name.

In order to use DEBUG, you must have write access to the program and be
operating in a session.  MPE checks whether you have read/write access to
the program file and are in an interactive session.  If either condition
is not true, DEBUG is not initiated.

When a program executed in DEBUG mode starts execution, it breaks before
the first instruction so that you can establish your breakpoints.  At
this initial break, a message is displayed indicating that you are in
DEBUG mode and specifying the entry point location relative to the start
of code of the first program unit to be executed.  (Refer to item 1 in
Figure 3-3).  The message has the form:

     *DEBUG* s.nnn 

where

s                is the segment number

nnn              is the location of the entry point.

DEBUG then displays the prompt for DEBUG commands, a question mark.  In
response to this prompt, you may enter any DEBUG command for which you
have the capability.  Usually, the first command you enter is B or R in
order to establish where you want to break during program execution.  The
B command simply establishes breakpoints or displays the existing
breakpoints.  R both establishes a breakpoint and resumes program
execution.  Whenever, a break occurs, you must specifically request
execution to continue with an R command or, alternatively, the E command.



MPE/iX 5.0 Documentation