HP Fortran for OpenVMS
User Manual
4.5 Debugger Command Summary
The following sections list all the debugger commands and any related
DCL commands in functional groupings, along with brief descriptions.
See the debugger's online help for complete details on commands.
During a debugging session, you can get online HELP on any command and
its qualifiers by typing the HELP command followed by the name of the
command in question. The HELP command has the following form:
4.5.1 Starting and Terminating a Debugging Session
$ RUN
|
Invokes the debugger if LINK/DEBUG was used.
|
$ RUN/[NO]DEBUG
|
Controls whether the debugger is invoked when the program is executed.
|
DBG> Ctrl/Z or EXIT
|
Ends a debugging session, executing all exit handlers.
|
DBG> QUIT
|
Ends a debugging session without executing any exit handlers declared
in the program.
|
DBG> Ctrl/C
|
Aborts program execution or a debugger command without interrupting the
debugging session.
|
ABORT_KEY
|
Assigns the default Ctrl/C abort function to another Ctrl-key sequence
or identifies the Ctrl-key sequence currently defined for the abort
function.
|
$ Ctrl/Y DEBUG
|
The sequence Ctrl/Y DEBUG interrupts a program that is running without
debugger control and invokes the debugger.
|
DBG> ATTACH
|
Passes control of your terminal from the current process to another
process (similar to the DCL command ATTACH).
|
DBG> SPAWN
|
Creates a subprocess; lets you issue DCL commands without interrupting
your debugging context (similar to the DCL command SPAWN).
|
$ DEBUG/KEEP
|
Invokes the kept debugger, which allows certain additional commands to
be used, including RUN and RERUN.
|
DBG> RUN
image-name
|
When using the kept debugger, runs the specified program.
|
DBG> RERUN
|
When using the kept debugger, runs the last program executed again.
|
4.5.2 Controlling and Monitoring Program Execution
GO
|
Starts or resumes program execution.
|
STEP
|
Executes the program up to the next line, instruction, or specified
instruction.
|
STEP
|
Establishes or displays the default qualifiers for the STEP command.
|
- SET
- SHOW
- CANCEL
- ACTIVATE
- DEACTIVATE
BREAK
|
Sets, displays, cancels, activates, or deactivates breakpoints.
|
- SET
- SHOW
- CANCEL
- ACTIVATE
- DEACTIVATE
TRACE
|
Sets, displays, cancels, activates, or deactivates tracepoints.
|
- SET
- SHOW
- CANCEL
- ACTIVATE
- DEACTIVATE
WATCH
|
Sets, displays, cancels, activates, or deactivates watchpoints.
|
SHOW CALLS
|
Identifies the currently active subroutine calls.
|
SHOW STACK
|
Gives additional information about the currently active subroutine
calls.
|
CALL
|
Calls a subroutine.
|
4.5.3 Examining and Manipulating Data
EXAMINE
|
Displays the value of a variable or the contents of a program location
|
SET MODE [NO]OPERANDS
|
Controls whether the address and contents of the instruction operands
are displayed when you examine an instruction.
|
DEPOSIT
|
Changes the value of a variable or the contents of a program location.
|
EVALUATE
|
Evaluates a language or address expression.
|
4.5.4 Controlling Type Selection and Symbolization
RADIX
|
Establishes the radix for data entry and display, displays the radix,
or restores the radix.
|
TYPE
|
Establishes the type for program locations that are not associated with
a compiler generated type, displays the type, or restores the type.
|
SET MODE [NO]G_FLOAT
|
Controls whether double-precision floating-point constants are
interpreted as G_FLOAT or D_FLOAT.
You can also use SET TYPE or EXAMINE commands to define untyped
program locations, such as SET TYPE S_FLOAT, EXAMINE/T_FLOAT, or
EXAMINE/X_FLOAT.
|
4.5.5 Controlling Symbol Lookup
SHOW SYMBOL
|
Displays symbols in your program
|
MODULE
|
Sets a module by loading its symbol records into the debugger's symbol
table, identifies a set module, or cancels a set module.
|
IMAGE
|
Sets a
shareable image by loading data structures into the debugger's symbol
table, identifies a set image, or cancels a set image.
|
SET MODE [NO]DYNAMIC
|
Controls whether modules and shareable images are set automatically
when the debugger interrupts execution.
|
SCOPE
|
Establishes, displays, or restores the scope for symbol lookup.
|
SET MODE [NO]LINE
|
Controls whether code locations are displayed as line numbers or
routine-name + byte offset.
|
SET MODE [NO]SYMBOLIC
|
Controls whether code locations are displayed symbolically or as
numeric addresses.
|
SYMBOLIZE
|
Converts a virtual address to a symbolic address.
|
4.5.6 Displaying Source Code
TYPE
|
Displays lines of source code.
|
EXAMINE/SOURCE
|
Displays the source code at the location specified by the address
expression.
|
SOURCE
|
Creates, displays, or cancels a source directory search list.
|
SEARCH
|
Searches the source code for the specified string.
|
SEARCH
|
Establishes or displays the default qualifiers for the SEARCH command.
|
SET STEP [NO]SOURCE
|
Enables or disables the display of source code after a STEP command has
been executed or at a breakpoint, tracepoint, or watchpoint.
|
MAX_SOURCE_FILES
|
Establishes or displays the maximum number of source files that may be
kept open at one time.
|
MARGINS
|
Establishes or displays the left and right margin settings for
displaying source code.
|
4.5.7 Using Screen Mode
SET MODE [NO]SCREEN
|
Enables or disables screen mode.
|
SET MODE [NO]SCROLL
|
Controls whether an output display is updated line by line or once per
command.
|
DISPLAY
|
Modifies an existing display.
|
DISPLAY
|
Creates, identifies, or deletes a display.
|
WINDOW
|
Creates, identifies, or deletes a window definition.
|
SELECT
|
Selects a display for a display attribute.
|
SHOW SELECT
|
Identifies the displays selected for each of the display attributes.
|
SCROLL
|
Scrolls a display.
|
SAVE
|
Saves the current contents of a display and writes it to another
display.
|
EXTRACT
|
Saves a display or the current screen state and writes it to a file.
|
EXPAND
|
Expands or contracts a display.
|
MOVE
|
Moves a display across the screen.
|
TERMINAL
|
Establishes or displays the height and width of the screen.
|
|
Refreshes the screen.
|
4.5.8 Editing Source Code
EDIT
|
Invokes an editor during a debugging session.
|
EDITOR
|
Establishes or identifies the editor invoked by the EDIT command.
|
4.5.9 Defining Symbols
DEFINE
|
Defines a symbol as an address, command, value, or process group.
|
DELETE
|
Deletes symbol definitions.
|
DEFINE
|
Establishes or displays the default qualifier for the DEFINE command.
|
SHOW SYMBOL/DEFINED
|
Identifies symbols that have been defined.
|
4.5.10 Using Keypad Mode
SET MODE [NO]KEYPAD
|
Enables or disables keypad mode.
|
DEFINE/KEY
|
Creates key definitions.
|
DELETE/KEY
|
Deletes key definitions.
|
SET KEY
|
Establishes the key definition state.
|
SHOW KEY
|
Displays key definitions.
|
4.5.11 Using Command Procedures and Log Files
DECLARE
|
Defines parameters to be passed to command procedures.
|
LOG
|
Specifies or identifies the debugger log file.
|
SET OUTPUT [NO]LOG
|
Controls whether a debugging session is logged.
|
SET OUTPUT [NO]SCREEN_LOG
|
Controls whether, in screen mode, the screen contents are logged as the
screen is updated.
|
SET OUTPUT [NO]VERIFY
|
Controls whether debugger commands are displayed as a command procedure
is executed.
|
SHOW OUTPUT
|
Displays the current output options established by the SET OUTPUT
command.
|
ATSIGN
|
Establishes or displays the default file specification that the
debugger uses to search for command procedures.
|
@file-spec
|
Executes a command procedure.
|
4.5.12 Using Control Structures
IF
|
Executes a list of commands conditionally.
|
FOR
|
Executes a list of commands repetitively.
|
REPEAT
|
Executes a list of commands repetitively.
|
WHILE
|
Executes a list of commands conditionally, possibly multiple times.
|
EXITLOOP
|
Exits an enclosing WHILE, REPEAT, or FOR loop.
|
4.5.13 Additional Commands
SET PROMPT
|
Specifies the debugger prompt.
|
SET OUTPUT [NO]TERMINAL
|
Controls whether debugger output is displayed or suppressed, except for
diagnostic messages.
|
LANGUAGE
|
Establishes or displays the current language.
|
|
Establishes or identifies the current run-time facility for
language-specific events.
|
SHOW EXIT_HANDLERS
|
Identifies the exit handlers declared in the program.
|
TASK
|
Modifies the tasking environment or displays task information.
|
AST
|
Disables the delivery of ASTs in the program, enables the delivery of
ASTs, or identifies whether delivery is enabled or disabled.
|
SET MODE [NO]SEPARATE
|
Controls whether a separate window is created on a workstation for
debugger input and output (this command has no effect on VT-series
terminals).
|
For More Information:
- On debugger commands and the DECwindows Motif interface, see the
HP OpenVMS Debugger Manual.
- On debugger command syntax, enter the online debugger HELP command.
4.6 Locating an Exception
The OpenVMS Debugger supports the SET BREAK/EXCEPTION and SET
TRACE/EXCEPTION commands to set a breakpoint or tracepoint when an
exception occurs. To allow precise reporting of the exception, compile
the program using:
- The FORTRAN command qualifier /SYNCHRONOUS_EXCEPTIONS (Alpha only)
- The FORTRAN command qualifier /CHECK=ALL (in general) or
/CHECK=FP_EXCEPTIONS (if you know it is a floating-point exception)
- The FORTRAN command qualifiers /DEBUG and /NOOPTIMIZE
If you use the FORTRAN command qualifier /FLOAT=IEEE_FLOAT to specify
IEEE floating-point (S_float and T_float) data, you can also use the
/IEEE_MODE qualifier to indicate how exceptions should be handled.
For example, you might use the following commands to create the
executable program:
$ FORTRAN/DEBUG/NOOPTIMIZE/FLOAT=IEEE_FLOAT/SYNCHRONOUS_EXC/CHECK=ALL TEST (1)
$ LINK/DEBUG TEST
$ RUN TEST
OpenVMS DEBUG (IA64 Debug64) Version x.x-xxx
%DEBUG-I-INITIAL, language is FORTRAN, module set to SQUARES
%DEBUG-I-NOTATMAIN, enter GO to get to start of main program
DBG> GO (2)
break at routine TEST$MAIN
1: REAL (KIND=4) :: A,B
DBG> SET BREAK/EXCEPTION DO (SHOW CALLS) (3)
DBG> GO (4)
%SYSTEM-F-HPARITH, high performance arithmetic trap, Imask=00000000,
Fmask=00000002, summary=08, PC=00020050, PS=0000001B (5)
-SYSTEM-F-FLTOVF, arithmetic trap,floating overflow at PC=00020050,PS=0000001B
break on exception preceding TEST$MAIN\%LINE 3+20
3: B=A*A
module name routine name line rel PC abs PC
*TEST$MAIN TEST$MAIN 3 00000050 00020050
00000130 00020130
SHARE$DEC$FORRTL
00000000 000B0A30
00000130 00020130
00000000 84F4BAD8
DBG> TYPE 1:3 (6)
1: REAL (KIND=4) :: A,B
2: A=2.5138E20
3: B=A*A
DBG> EXIT
$
|
- The FORTRAN command line specifies qualifiers
that ensure reporting of exceptions and sufficient information for
debugging.
The LINK command /DEBUG qualifier requests that debug
symbol information be included in the executable image.
- The first debugger GO command is needed
because run-time checking was requested.
- The debugger command SET BREAK/EXCEPTION sets
a breakpoint for exceptions. If omitted, the exception is not reported.
- The second debugger GO command runs the
program.
- The "%SYSTEM-F-HPARITH, high performance
arithmetic trap" message indicates an exception has occurred. The
"-SYSTEM-F-FLTOVF, arithmetic trap, floating overflow"
message indicates the type of exception. The remaining display
(requested by the SHOW CALLS command) shows the routine and line number
where the error occurred.
- The TYPE command displays the area of source
code associated with the exception.
For More Information:
4.7 Locating Unaligned Data
The OpenVMS Debugger supports the SET BREAK/UNALIGNED command to set a
breakpoint when unaligned data is accessed. To allow precise reporting
of the source code accessing the unaligned data, compile the program
using the FORTRAN command qualifier /SYNCHRONOUS_EXCEPTIONS (Alpha
only).
For example, you might use the following commands to create the
executable program:
$ FORTRAN/DEBUG/NOOPTIMIZE/SYNCHRONOUS_EXCEPT INV_ALIGN (1)
$ LINK/DEBUG INV_ALIGN
$ RUN INV_ALIGN
OpenVMS DEBUG (IA64 Debug64) Version x.x-xxx
%DEBUG-I-INITIAL, language is FORTRAN, module set to INV_ALIGN
DBG> SET BREAK/UNALIGNED (2)
DBG> GO
Unaligned data access: virtual address = 0003000A, PC = 000200A0 (3)
break on unaligned data trap preceding INV_ALIGN\OOPS\%LINE 10
10: end
DBG> TYPE 7:9
7: subroutine oops(i4)
8: integer*4 i4
9: i4 = 1
DBG> EXIT
$
|
- The FORTRAN command line specifies qualifiers
that ensure reporting of exceptions and sufficient information for
debugging.
The LINK command /DEBUG qualifier requests that debug
symbol information be included in the executable image.
- The debugger command SET BREAK/UNALIGNED sets
a breakpoint for unaligned data. If omitted, the unaligned data would
not be reported.
- The "Unaligned data access" message
indicate the line causing the unaligned data was just before line 10.
The TYPE command is used to display the lines before line 10. In
this case, the integer argument whose address is passed to subroutine
OOPS is unaligned, resulting in the unaligned access.
For More Information:
- On unaligned data, see Section 5.3.
- On the FORTRAN command /ALIGNMENT qualifier, see Section 2.3.3.
- On other FORTRAN command qualifiers, see Section 2.3 or online
DCL HELP (HELP FORTRAN).