HP OpenVMS Systems Documentation
HP OpenVMS Debugger Manual
8.4.4 Displaying Help on Debugger Diagnostic Messages
Figure 9-1 Debugger at Startup
Figure 9-2 Running a Program by Specifying an Image
$X1 :== RUN MYDISK:[MYDIR.MYSUBDIR]EIGHTQUEENS.EXE
Figure 9-3 Running a Program by Specifying a Command Symbol
Once the debugger has control of the program, the debugger:
Figure 9-4 Source Display at Startup
The message displayed in the command view indicates that this debugging session is initialized for a C program and that the name of the source module is EIGHTQUEENS.
Type GO to reach MAIN program No source line for address: nnnnnnnn
With some of these programs (for example, Ada programs), the breakpoint enables you to debug the initialization code using full symbolic information. The initialization sets up language-dependent debugger parameters. These parameters control the way the debugger parses names and expressions, formats debugger output, and so on.
You can now debug your program as explained in Chapter 10.
Note the following restrictions about running a program under debugger control:
%DCL-W-ACTIMAGE, error activating image -CLI-E-IMAGEFNF, image file not found
'Normal successful completion'
You then have the following options:
When running the kept debugger (see Section 9.1), you can rerun the program currently under debugger control at any time during a debugging session.
To rerun the program:
Figure 9-5 Rerunning the Same Program
When you rerun a program, it is in the same initial state as a program that is brought under debugger control as explained in Section 9.1, except for any saved breakpoints, tracepoints, or static watchpoints. The source display and current location pointer are updated accordingly.
When you rerun a program, the debugger uses the same version of the
image that is currently under debugger control. To debug a different
version of that program (or a different program) from the same
debugging session, choose Run Image... or Run Foreign Command.. from
the File menu on the main window (see Section 9.1).
9.4 Running Another Program from the Current Debugging Session
You can bring another program under debugger control at any time during
a debugging session, if you started the debugger as explained in
Section 9.1. Follow the procedure in that section for bringing a
program under debugger control (also note the restrictions about using
9.5 Debugging an Already Running Program
This section describes how to debug a program that is already running in a subprocess or in a detached process. Perform the following steps:
$ RUN/DETACH/INPUT=xxx.com SYS$SYSTEM:LOGINOUT
To interrupt program execution during a debugging session, click on the Stop button on the push button view (see Figure 8-3). This is useful if, for example, the program is in an infinite loop.
To abort a debugger operation in progress, click on Stop. This is useful if, for example, the debugger is displaying a long stream of data.
Clicking on Stop does not end the debugging session. Clicking on Stop
has no effect when the program is not running or when the debugger is
not executing a command.
9.7 Ending a Debugging Session
To end a debugging session and terminate the debugger, choose Exit Debugger from the File menu on the main window, or enter EXIT at the prompt (to avoid confirmation dialogue). This returns control to system level.
To rerun your program from the current debugging session, see Section 9.3.
In addition to the startup procedure described in Section 9.1, the following options are available for starting the debugger from DCL level ($):
You can start the debugger and also bring your program under debugger control in one step by entering the DCL command RUN filespec (assuming the program was compiled and linked with the /DEBUG qualifier).
However, you cannot then use the Rerun or Run features explained in Section 9.3 and Section 9.4, respectively. To rerun the same program or run a new program under debugger control, you must first exit the debugger and start it again.
To start the debugger by running a program, enter the DCL command RUN filespec to start the debugger. For example:
$ RUN EIGHTQUEENS
By default, the debugger starts up as shown in Figure 9-4, executing any user-defined initialization file and displaying the program's source code in the main window. The current-location pointer shows that execution is paused at the start of the main program. The debugger sets the language-dependent parameters to the source language of the main program unit.
For more information about debugger startup, see Section 9.1.
9.8.2 Starting the Debugger After Interrupting a Running Program
You can bring a program that is executing freely under debugger
control. This is useful if you suspect that the program might be in an
infinite loop or if you see erroneous output.
To bring your program under debugger control:
$ RUN/NODEBUG EIGHTQUEENS . . . [Ctrl/Y] Interrupt $ DEBUG [starts debugger]
At startup, the debugger displays the main window and executes any user-defined initialization file, and sets the language-dependent parameters to the source language of the module in which execution was interrupted.
To help you determine where execution was interrupted:
When you start the debugger in this manner, you cannot then use the Rerun or Run features explained in Section 9.3 and Section 9.4, respectively. To rerun the same program or run a new program under debugger control, you must first exit the debugger and start it again.
By default, if your workstation is running HP DECwindows Motif for OpenVMS, the debugger starts up in the HP DECwindows Motif for OpenVMS user interface, which is displayed on the workstation specified by the HP DECwindows Motif for OpenVMS applicationwide logical name DECW$DISPLAY.
This section explains how to override the debugger's default DECwindows Motif user interface to achieve the following:
The logical name DBG$DECW$DISPLAY enables you to override the default interface of the debugger. In most cases, there is no need to define DBG$DECW$DISPLAY because the default is appropriate.
Section 22.214.171.124 provides more information about the logical names
DBG$DECW$DISPLAY and DECW$DISPLAY.
126.96.36.199 Displaying the Debugger's HP DECwindows Motif for OpenVMS User Interface on Another Workstation
If you are debugging a HP DECwindows Motif for OpenVMS application that uses most of the screen (or if you are debugging pop-ups in a Motif application), you might find it useful to run the program on one workstation and display the debugger's HP DECwindows Motif for OpenVMS user interface on another. To do so:
DEFINE/JOB DBG$DECW$DISPLAY workstation_pathname
To display the debugger's command interface in a DECterm window, along with any program I/O:
$ DEFINE/JOB DBG$DECW$DISPLAY " "
$ DEFINE/JOB DBG$DECW$DISPLAY " " $ DEBUG/KEEP Debugger Banner and Version Number DBG>
You can now bring your program under debugger control as explained in
188.8.131.52 Displaying the Command Interface and Program Input/Output in Separate DECterm Windows
This section describes how to display the debugger's command interface in a DECterm window other than the DECterm window in which you start the debugger. This separate window is useful when using the command interface to debug a screen-oriented program as follows:
The effect is the same as entering the SET MODE SEPARATE command at the DBG> prompt on a workstation running VWS rather than HP DECwindows Motif for OpenVMS. (The SET MODE SEPARATE command is not valid when used in a DECterm window.)
The following example shows how to display the debugger's command interface in a separate debugger window titled Debugger.
|Example 9-1 Command Procedure SEPARATE_WINDOW.COM|
$ ! Simulates effect of SET MODE SEPARATE from a DECterm window $ ! $ CREATE/TERMINAL/NOPROCESS - /WINDOW_ATTRIBUTES=(TITLE="Debugger",- ICON_NAME="Debugger",ROWS=40)- /DEFINE_LOGICAL=(TABLE=LNM$JOB,DBG$INPUT,DBG$OUTPUT) $ ALLOCATE DBG$OUTPUT $ EXIT $ ! $ ! The command CREATE/TERMINAL/NOPROCESS creates a DECterm $ ! window without a process. $ ! $ ! The /WINDOW_ATTRIBUTES qualifier specifies the window's $ ! title (Debugger), icon name (Debugger), and the number $ ! of rows in the window (40). $ ! $ ! The /DEFINE_LOGICAL qualifier assigns the logical names $ ! DBG$INPUT and DBG$OUTPUT to the window, so that it becomes $ ! the debugger input and output device. $ ! $ ! The command ALLOCATE DBG$OUTPUT causes the separate window $ ! to remain open when you end the debugging session.
$ @SEPARATE_WINDOW %DCL-I-ALLOC, _MYNODE$TWA8: allocated
$ DEASSIGN/JOB DBG$INPUT $ DEASSIGN/JOB DBG$OUTPUT