Document revision date: 30 March 2001
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]

OpenVMS Debugger Manual


Previous Contents Index

This command causes the debugger to trace the beginning of routine SUB3 when that routine is executed.
#2

DBG> SET TRACE/BRANCH/CALL
      

This command causes the debugger to trace every BRANCH instruction and every CALL instruction encountered during program execution.

#3

DBG> SET TRACE/LINE/INTO/NOSHARE/NOSYSTEM
      

This command causes the debugger to trace the beginning of every source line, including lines in called routines (/INTO) but not in shareable image routines (/NOSHARE) or system routines (/NOSYSTEM).

#4

DBG> SET TRACE/NOSOURCE TEST5\%LINE 14 WHEN (X .NE. 2) DO (EXAMINE Y)
      

This command causes the debugger to trace line 14 of module TEST5 when X is not equal to 2. At the tracepoint, the EXAMINE Y command is issued. The /NOSOURCE qualifier suppresses the display of source code at the tracepoint. The syntax of the conditional expression in the WHEN clause is language-dependent.

#5

DBG> SET TRACE/INSTRUCTION WHEN (X .NE. 0)
      

This command causes the debugger to trace when X is not equal to 0. The condition is tested at each instruction encountered during execution. The syntax of the conditional expression in the WHEN clause is language-dependent.

#6

DBG> SET TRACE/SILENT SUB2 DO (SET WATCH K)
      

This command causes the debugger to trace the beginning of routine SUB2 during execution. At the tracepoint, the DO clause sets a watchpoint on variable K. The /SILENT qualifier suppresses the "trace ..." message and the display of source code at the tracepoint. This example shows a convenient way of setting a watchpoint on a nonstatic (stack or register) variable. A nonstatic variable is defined only when its defining routine (SUB2, in this case) is active (on the call stack).

#7

DBG> SET TRACE/RETURN ROUT4 DO (EXAMINE X)
      

This command causes the debugger to trace the return instruction of routine ROUT4 (that is, just before execution returns to the calling routine). At the tracepoint, the DO clause issues the EXAMINE X command. This example shows a convenient way of obtaining the value of a nonstatic variable just before execution leaves that variable's defining routine.

#8

DBG> SET TRACE/EVENT=TERMINATED
      

This command causes the debugger to trace the point at which any task makes a transition to the TERMINATED state.


SET TYPE

Establishes the default type to be associated with program locations that do not have a symbolic name (and, therefore, do not have an associated compiler-generated type). When used with /OVERRIDE, it establishes the default type to be associated with all locations, overriding any compiler-generated types.

Format

SET TYPE type-keyword


Parameters

type-keyword

Specifies the default type to be established. Valid keywords are as follows:
ASCIC Sets the default type to counted ASCII string with a 1-byte count field that precedes the string and gives its length. AC is also accepted as a keyword.
ASCID Sets the default type to ASCII string descriptor. The CLASS and DTYPE fields of the descriptor are not checked, but the LENGTH and POINTER fields provide the character length and address of the ASCII string. The string is then displayed. AD is also accepted as a keyword.
ASCII: n Sets the default type to ASCII character string (length n bytes). The length indicates both the number of bytes of memory to be examined and the number of ASCII characters to be displayed. If you do not specify a value for n, the debugger uses the default value of 4 bytes. The value n is interpreted in decimal radix.
ASCIW Sets the default type to counted ASCII string with a 2-byte count field that precedes the string and gives its length. This data type occurs in Pascal and PL/I. AW is also accepted as a keyword.
ASCIZ Sets the default type to zero-terminated ASCII string. The ending zero byte indicates the end of the string. AZ is also accepted as a keyword.
BYTE Sets the default type to byte integer (length 1 byte).
D_FLOAT Sets the default type to D_floating (length 8 bytes).
DATE_TIME Sets the default type to date and time. This is a quadword integer (length 8 bytes) containing the internal representation of date and time. Values are displayed in the format dd-mmm-yyyy hh:mm:ss.cc. Specify an absolute date and time as follows:
[dd-mmm-yyyy[:]] [hh:mm:ss.cc]

EXTENDED_FLOAT (Alpha only) Sets the default type to IEEE X_floating (length 16 bytes).
FLOAT On VAX systems, sets the default type to F_floating (length 4 bytes).

On Alpha processors, sets the default type to IEEE T_floating (length 8 bytes).

G_FLOAT Sets the default type to G_floating (length 8 bytes).
H_FLOAT (VAX only) Sets the default type to H_floating (length 16 bytes).
INSTRUCTION Sets the default type to instruction (variable length, depending on the number of instruction operands and the kind of addressing modes used).
LONG_FLOAT (Alpha only) Sets the default type to IEEE S_Floating type (single precision, length 4 bytes).
LONG_LONG_FLOAT (Alpha only) Sets the default type to IEEE T_Floating type (double precision, length 8 bytes).
LONGWORD Sets the default type to longword integer (length 4 bytes). This is the default type for program locations that do not have a symbolic name (do not have a compiler-generated type).
OCTAWORD Sets the default type to octaword integer (length 16 bytes).
PACKED: n Sets the default type to packed decimal. The value of n is the number of decimal digits. Each digit occupies one nibble (4 bits).
QUADWORD Sets the default type to quadword integer (length 8 bytes). This might be advisable for debugging 64-bit applications.
TYPE=( expression) Sets the default type to the type denoted by expression (the name of a variable or data type declared in the program). This enables you to specify an application-declared type.
S_FLOAT (Alpha only) Same as LONG_FLOAT.
T_FLOAT (Alpha only) Same as LONG_LONG_FLOAT.
WORD Sets the default type to word integer (length 2 bytes).
X_FLOAT (Alpha only) Same as EXTENDED_FLOAT.

Qualifiers

/OVERRIDE

Associates the type specified with all program locations, whether or not they have a symbolic name (whether or not they have an associated compiler-generated type).

Description

When you use EXAMINE, DEPOSIT, or EVALUATE commands, the default types associated with address expressions affect how the debugger interprets and displays program entities.

The debugger recognizes the compiler-generated types associated with symbolic address expressions (symbolic names declared in your program), and it interprets and displays the contents of these locations accordingly. For program locations that do not have a symbolic name and, therefore, no associated compiler-generated type, the default type in all languages is longword integer, which is appropriate for debugging 32-bit applications.

On Alpha systems, when debugging applications that use the 64-bit address space, you should use the SET TYPE QUADWORD command.

The SET TYPE command enables you to change the default type associated with locations that do not have a symbolic name. The SET TYPE/OVERRIDE command enables you to set a default type for all program locations, both those that do and do not have a symbolic name.

The EXAMINE and DEPOSIT commands have type qualifiers (/ASCII, /BYTE, /G_FLOAT, and so on) which enable you to override, for the duration of a single command, the type previously associated with any program location.

Related commands:

CANCEL TYPE/OVERRIDE
DEPOSIT
EXAMINE
(SET,SHOW,CANCEL) RADIX
(SET,SHOW,CANCEL) MODE
SHOW TYPE

Examples

#1

DBG> SET TYPE ASCII:8
      

This command establishes an 8-byte ASCII character string as the default type associated with untyped program locations.

#2

DBG> SET TYPE/OVERRIDE LONGWORD
      

This command establishes longword integer as the default type associated with both untyped program locations and program locations that have compiler-generated types.

#3

DBG> SET TYPE D_FLOAT
      

This command establishes D_Floating as the default type associated with untyped program locations.

#4

DBG> SET TYPE TYPE=(S_ARRAY)
      

This command establishes the type of the variable S_ARRAY as the default type associated with untyped program locations.


SET VECTOR_MODE (VAX only)

Enables or disables a debugger vector mode option.

Applies only to VAX vectorized programs.


Format

SET VECTOR_MODE vector-mode-option


Parameters

vector-mode-option

Specifies the vector mode option. Valid keywords are as follows:
SYNCHRONIZED Specifies that the debugger force automatic synchronization between the scalar and vector processors whenever a vector instruction is executed. Specifically, the debugger issues a SYNC instruction after every vector instruction and, in addition, an MSYNC instruction after any vector instruction that accesses memory. This forces the completion of all activities associated with the vector instruction that is being synchronized:
  • Any exception that was caused by a vector instruction is delivered before the next scalar instruction is executed. Forcing the delivery of a pending exception triggers an exception breakpoint or tracepoint (if one was set) or invokes an exception handler (if one is available at that location in the program).
  • Any read or write operation between vector registers and either the general registers or memory is completed before the next scalar instruction is executed.

The SET VECTOR_MODE SYNCHRONIZED command does not issue an immediate SYNC or MSYNC instruction at the time it is issued. To force immediate synchronization, use the SYNCHRONIZE VECTOR_MODE command.

NOSYNCHRONIZED (Default) Specifies that the debugger not force synchronization between the scalar and vector processors except for internal debugger purposes. As a result, any synchronization is controlled entirely by the program, and the program runs as if it were not under debugger control.

Description

Vector mode options control the way in which the debugger interacts with the vector processor. For details about the SET VECTOR_MODE command, see the parameter descriptions.

Related commands:

(SHOW,SYNCHRONIZE) VECTOR_MODE

Examples

#1

DBG> SET VECTOR_MODE SYNCHRONIZED
      

This command causes the debugger to force synchronization between the scalar and vector processors after each vector instruction is executed.

#2

DBG> SHOW VECTOR_MODE
Vector mode is nonsynchronized
DBG> SET VECTOR_MODE SYNCHRONIZED   (1)
DBG> SHOW VECTOR_MODE
Vector mode is synchronized
DBG> STEP   (2)
stepped to .MAIN.\SUB\%LINE 99 
    99:         VVDIVD  V1,V0,V2
DBG> STEP   (3)
%SYSTEM-F-VARITH, vector arithmetic fault, summary=00000002, 
                  mask=00000004, PC=000002E1, PSL=03C00010 
break on unhandled exception preceding .MAIN.\SUB\%LINE 100 
   100:         CLRL    R0
DBG>
 
      

The comments that follow refer to the callouts in the previous example:

  1. The SET VECTOR_MODE SYNCHRONIZED command causes the debugger to force automatic synchronization between the scalar and vector processors whenever a vector instruction is executed.
  2. This STEP command suspends program execution on line 99, just before a VVDIVD instruction is executed. Assume that, in this example, the instruction will trigger a floating-point divide-by-zero exception.
  3. This STEP command executes the VVDIVD instruction, which triggers the exception. The vector exception is delivered immediately because the debugger is being operated in synchronized vector mode.

SET WATCH

Establishes a watchpoint at the location denoted by an address expression.

Format

SET WATCH address-expression[,...]
[WHEN(conditional-expression)]
[DO(command[;...])]


Parameters

address-expression

Specifies an address expression (a program location) at which a watchpoint is to be set. With high-level languages, this is typically the name of a program variable and can include a path name to uniquely specify the variable. More generally, an address expression can also be a memory address or a register and can be composed of numbers (offsets) and symbols, as well as one or more operators, operands, or delimiters. For information about the operators that you can use in address expressions, type Help Address_Expressions.

Do not specify the asterisk (*) wildcard character.

conditional-expression

Specifies a conditional expression in the currently set language; the expression is to be evaluated whenever execution reaches the watchpoint. (The debugger checks the syntax of the expressions in the WHEN clause when execution reaches the watchpoint, not when the watchpoint is set.) If the expression is true, the debugger reports that a watchpoint has been triggered. If an action (DO clause) is associated with the watchpoint, it will occur at this time. If the expression is false, a report is not issued, the commands specified by the DO clause (if one was specified) are not executed, and program execution is continued.

command

Specifies a debugger command to be executed as part of the DO clause when watch action is taken. The debugger checks the syntax of the commands in a DO clause when it executes the DO clause, not when the watchpoint is set.

Qualifiers

/AFTER:n

Specifies that watch action not be taken until the nth time the designated watchpoint is encountered (n is a decimal integer). Thereafter, the watchpoint occurs every time it is encountered provided that conditions in the WHEN clause are true. The SET WATCH/AFTER:1 command has the same effect as SET WATCH.

/INTO

Specifies that the debugger is to monitor a nonstatic variable by tracing instructions not only within the defining routine, but also within a routine that is called from the defining routine (and any other such nested calls). The SET WATCH/INTO command enables you to monitor nonstatic variables within called routines more precisely than SET WATCH/OVER; but the speed of execution within called routines is faster with SET WATCH/OVER.

/OVER

Specifies that the debugger is to monitor a nonstatic variable by tracing instructions only within the defining routine, not within a routine that is called by the defining routine. As a result, the debugger executes a called routine at normal speed and resumes tracing instructions only when execution returns to the defining routine. The SET WATCH/OVER command provides faster execution than SET WATCH/INTO; but if a called routine modifies the watched variable, execution is interrupted only upon returning to the defining routine. When you set watchpoints on nonstatic variables, SET WATCH/OVER is the default.

/SILENT

/NOSILENT (default)

Controls whether the "watch..." message and the source line for the current location are displayed at the watchpoint. The /NOSILENT qualifier specifies that the message is displayed. The /SILENT qualifier specifies that the message and source line are not displayed. The /SILENT qualifier overrides /SOURCE.

/SOURCE (default)

/NOSOURCE

Controls whether the source line for the current location is displayed at the watchpoint. The /SOURCE qualifier specifies that the source line is displayed. The /NOSOURCE qualifier specifies that the source line is not displayed. The /SILENT qualifier overrides /SOURCE. See also the SET STEP [NO]SOURCE command.

/STATIC

/NOSTATIC

Enables you to override the debugger's default determination of whether a specified variable (watchpoint location) is static or nonstatic. The /STATIC qualifier specifies that the debugger should treat the variable as a static variable, even though it might be allocated in P1 space. This causes the debugger to monitor the location by using the faster write-protection method rather than by tracing every instruction. The /NOSTATIC qualifier specifies that the debugger should treat the variable as a nonstatic variable, even though it might be allocated in P0 space, and causes the debugger to monitor the location by tracing every instruction. Be careful when using these qualifiers.

/TEMPORARY

Causes the watchpoint to disappear after it is triggered (the watchpoint does not remain permanently set).

Description

When an instruction causes the modification of a watchpoint location, the debugger takes the following actions:
  1. Suspends program execution after that instruction has completed execution.
  2. If you specified /AFTER when you set the watchpoint, checks the AFTER count. If the specified number of counts has not been reached, execution continues and the debugger does not perform the remaining steps.
  3. Evaluates the expression in a WHEN clause, if you specified one when you set the watchpoint. If the value of the expression is false, execution continues and the debugger does not perform the remaining steps.
  4. Reports that execution has reached the watchpoint location ("watch of...") unless you specified /SILENT.
  5. Reports the old (unmodified) value at the watchpoint location.
  6. Reports the new (modified) value at the watchpoint location.
  7. Displays the line of source code at which execution is suspended, unless you specified /NOSOURCE or /SILENT when you set the watchpoint or entered a previous SET STEP NOSOURCE command.
  8. Executes the commands in a DO clause, if you specified one when you set the watchpoint. If the DO clause contains a GO command, execution continues and the debugger does not perform the next step.
  9. Issues the prompt.

For high-level language programs, the address expressions you specify with the SET WATCH command are typically variable names. If you specify an absolute memory address that is associated with a compiler-generated type, the debugger symbolizes the address and uses the length in bytes associated with that type to determine the length in bytes of the watchpoint location. If you specify an absolute memory address that the debugger cannot associate with a compiler-generated type, the debugger watches 4 bytes of memory, by default, beginning at the byte identified by the address expression. You can change this length, however, by setting the type to either WORD (SET TYPE WORD, which changes the default length to 2 bytes) or BYTE (SET TYPE BYTE, which changes the default length to 1 byte). SET TYPE LONGWORD restores the default length of 4 bytes.

You can set watchpoints on aggregates (that is, entire arrays or records). A watchpoint set on an array or record triggers if any element of the array or record changes. Thus, you do not need to set watchpoints on individual array elements or record components. Note, however, that you cannot set an aggregate watchpoint on a variant record.

You can also set a watchpoint on a record component, on an individual array element, or on an array slice (a range of array elements). A watchpoint set on an array slice triggers if any element within that slice changes. When setting the watchpoint, follow the syntax of the current language.

The following qualifiers affect what output is seen when a watchpoint is reached:

/[NO]SILENT
/[NO]SOURCE

The following qualifiers affect the timing and duration of watchpoints:

/AFTER:n
/TEMPORARY

The following qualifiers apply only to nonstatic variables:

/INTO
/OVER

The following qualifier overrides the debugger's determination of whether a variable is static or nonstatic:

/[NO]STATIC

Note

On VAX systems, watchpoints set on variables whose addresses are in global sections do not work. Attempting to set a watchpoint on a location in a global section results in a %DEBUG-E-BADWATCH message.

Static and Nonstatic Watchpoints

The technique for setting a watchpoint depends on whether the variable is static or nonstatic.

A static variable is associated with the same memory address throughout execution of the program. You can always set a watchpoint on a static variable throughout execution.

A nonstatic variable is allocated on the call stack or in a register and has a value only when its defining routine is active (on the call stack). Therefore, you can set a watchpoint on a nonstatic variable only when execution is currently suspended within the scope of the defining routine (including any routine called by the defining routine). The watchpoint is canceled when execution returns from the defining routine. With a nonstatic variable, the debugger traces every instruction to detect any changes in the value of a watched variable or location.

Another distinction between static and nonstatic watchpoints is speed of execution. To watch a static variable, the debugger write-protects the page containing the variable. If your program attempts to write to that page, an access violation occurs and the debugger handles the exception, determining whether the watched variable was modified. Except when writing to that page, the program executes at normal speed.

To watch a nonstatic variable, the debugger traces every instruction in the variable's defining routine and checks the value of the variable after each instruction has been executed. Since this significantly slows execution, the debugger issues a message when you set a nonstatic watchpoint.

As explained in the next paragraphs, /[NO]STATIC, /INTO, and /OVER enable you to exercise some control over speed of execution and other factors when watching variables.

The debugger determines whether a variable is static or nonstatic by checking how it is allocated. Typically, a static variable is in P0 space (0 to 3FFFFFFF, hexadecimal); a nonstatic variable is in P1 space (40000000 to 7FFFFFFF) or in a register. The debugger issues a warning if you try to set a watchpoint on a variable that is allocated in P1 space or in a register when execution is not currently suspended within the scope of the defining routine.

The /[NO]STATIC qualifiers enable you to override this default behavior. For example, if you have allocated nonstack storage in P1 space, use /STATIC when setting a watchpoint on a variable that is allocated in that storage area. This enables the debugger to use the faster write-protection method of watching the location instead of tracing every instruction. Conversely, if, for example, you have allocated your own call stack in P0 space, use /NOSTATIC when setting a watchpoint on a variable that is allocated on that call stack. This enables the debugger to treat the watchpoint as a nonstatic watchpoint.


Previous Next Contents Index

  [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
  privacy and legal statement  
4538PRO_056.HTML