Previous | Contents | Index |
You usually display the values of variables by using the debugger
EXAMINE command, which accepts numerous qualifiers.
4.4.1 Accessing Compaq Fortran Common Block Variables
To display common block variables, type the EXAMINE command followed by the variable names that make up the common block. For example:
DBG> TYPE 1:8 1: 2: PROGRAM TEST 3: INTEGER*4 INT4 4: CHARACTER(LEN=1) CHR 5: COMMON /COM_STRA/ INT4, CHR 6: CHR = 'L' 7: INT4 = 0 8: END PROGRAM TEST DBG> STEP 3 stepped to TEST\%LINE 8 8: END PROGRAM TEST DBG> EXAMINE CHR, INT4 TEST\CHR: 'L' TEST\INT4: 0 |
To display derived-type structure variables, type the EXAMINE command followed by the derived-type variable name, a period (.) (or a %), and the member name. For example:
DBG> TYPE 1:6 1: PROGRAM TEST 2: 3: TYPE X 4: INTEGER A(5) 5: END TYPE X 6: TYPE (X) Z 7: 8: Z%A = 1 DBG> STEP 2 stepped to TEST\%LINE 10 10: END PROGRAM TEST DBG> EXAMINE Z.A TEST\Z.A(1:5) (1): 1 (2): 1 (3): 1 (4): 1 (5): 1 |
To display a field in a record structure, type the EXAMINE command followed by the record name, a period (.), and the field name. To display the entire record structure, type EXAMINE command followed by the record name. For example:
DBG> TYPE 1:9 module TEST 1: PROGRAM TEST 2: STRUCTURE /STRA/ 3: INTEGER*4 INT4 4: CHARACTER(LEN=1) CHR 5: END STRUCTURE 6: RECORD /STRA/ REC 7: 8: REC.CHR = 'L' 9: END PROGRAM TEST DBG> STEP 2 stepped to TEST\%LINE 11 11: END PROGRAM TEST DBG> EXAMINE REC.CHR TEST\REC.CHR: 'L' DBG> EXAMINE REC.INT4 TEST\REC.INT4: 0 DBG> EXAMINE REC TEST\REC INT4: 0 CHR: 'L' |
To display one or more array elements, type the EXAMINE command followed by the array name and subscripts in parentheses, as in Fortran source statements. To display the entire array, type EXAMINE following by the array name. For example:
DBG> TYPE 1:5 module ARRAY1 1: PROGRAM ARRAY1 2: INTEGER (KIND=4) ARRAY1(6) 3: ARRAY1 = 0 4: ARRAY1(1) = 1 5: ARRAY1(2) = 2 DBG> STEP 5 stepped to ARRAY1\%LINE 8 DBG> EXAMINE ARRAY1(1:2) ARRAY\ARRAY1(1): 1 ARRAY\ARRAY1(2): 2 DBG> EXAMINE ARRAY1 ARRAY\ARRAY1(1:6) (1): 1 (2): 2 (3): 0 (4): 0 (5): 0 (6): 0 |
To display a variable defined in a module, type a SET MODULE command before examining module variables. For example, with a variable named PINTA defined in a module named MOD1, enter the following EXAMINE command to display its value:
DBG> SET MODULE MOD1 DBG> TYPE 1:6 1: PROGRAM USEMODULE 2: USE MOD1 3: INT4=0 4: INT4(1)=1 5: PINTA = 4 6: END PROGRAM USEMODULE DBG> STEP 4 stepped to USEMODULE\%LINE 6 6: END PROGRAM USEMODULE DBG> EXAMINE PINTA USEMODULE\PINTA: 4 |
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:
HELP command |
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. |
|
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. |
GO | Starts or resumes program execution. |
STEP | Executes the program up to the next line, instruction, or specified instruction. |
|
Establishes or displays the default qualifiers for the STEP command. |
|
Sets, displays, cancels, activates, or deactivates breakpoints. |
|
Sets, displays, cancels, activates, or deactivates tracepoints. |
|
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. |
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. |
|
Establishes the radix for data entry and display, displays the radix, or restores the radix. |
|
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. |
TYPE | Displays lines of source code. |
EXAMINE/SOURCE | Displays the source code at the location specified by the address expression. |
|
Creates, displays, or cancels a source directory search list. |
SEARCH | Searches the source code for the specified string. |
|
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. |
|
Establishes or displays the maximum number of source files that may be kept open at one time. |
|
Establishes or displays the left and right margin settings for displaying source code. |
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. |
|
Creates, identifies, or deletes a display. |
|
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. |
|
Establishes or displays the height and width of the screen. |
|
Refreshes the screen. |
EDIT | Invokes an editor during a debugging session. |
|
Establishes or identifies the editor invoked by the EDIT command. |
DEFINE | Defines a symbol as an address, command, value, or process group. |
DELETE | Deletes symbol definitions. |
|
Establishes or displays the default qualifier for the DEFINE command. |
SHOW SYMBOL/DEFINED | Identifies symbols that have been defined. |
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. |
DECLARE | Defines parameters to be passed to command procedures. |
|
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. |
|
Establishes or displays the default file specification that the debugger uses to search for command procedures. |
@file-spec | Executes a command procedure. |
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. |
SET PROMPT | Specifies the debugger prompt. |
SET OUTPUT [NO]TERMINAL | Controls whether debugger output is displayed or suppressed, except for diagnostic messages. |
|
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. |
|
Modifies the tasking environment or displays task information. |
|
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:
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:
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 Alpha DEBUG Version x.x-xxx %DEBUG-I-INITIAL, language is FORTRAN, module set to SQUARES %DEBUG-I-NOTATMAIN, type 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 $ |
For More Information:
Previous | Next | Contents | Index |