Updated: 11 December 1998 |
OpenVMS Debugger Manual
Previous | Contents | Index |
Bit-Field Operator
The following example shows how to use the bit-field operator. For example, to examine the address expression X_NAME starting at bit 3 with a length of 4 bits and no sign extension, enter the following command:
DBG> EXAMINE X_NAME <3,4,0> |
The following built-in symbols enable you to obtain information about the current exception and use that information to qualify breakpoints or tracepoints:
Symbol | Description |
---|---|
%EXC_FACILITY | Name of facility that issued the current exception |
%EXC_NAME | Name of current exception |
%ADAEXC_NAME | Ada exception name of current exception (for Ada programs only) |
%EXC_NUMBER | Number of current exception |
%EXC_SEVERITY | Severity code of current exception |
For example:
DBG> EVALUATE %EXC_NAME "FLTDIV_F" DBG> SET BREAK/EXCEPTION WHEN (%EXC_NAME = "FLTDIV_F") . . . DBG> EVALUATE %EXC_NUMBER 12 DBG> EVALUATE/CONDITION_VALUE %EXC_NUMBER %SYSTEM-F-ACCVIO, access violation at PC !XL, virtual address !XL DBG> SET BREAK/EXCEPTION WHEN (%EXC_NUMBER = 12) |
The conditional expressions in the WHEN clauses are language-specific.
B.3.9 Specifying the Current, Next, and Previous Scope on the Call Stack
You can use the following built-in symbols to obtain and manipulate the scope for symbol lookup and for source or instruction display relative to the routine call stack:
Built-in Symbol | Description |
---|---|
%CURRENT_SCOPE_ENTRY | The call frame that the debugger is currently using as reference when displaying source code or decoded instructions, or when searching for symbols. By default, this is call frame 0. |
%NEXT_SCOPE_ENTRY | The next call frame down the call stack from the call frame denoted by %CURRENT_SCOPE_ENTRY. |
%PREVIOUS_SCOPE_ENTRY | The next call frame up the call stack from the call frame denoted by %CURRENT_SCOPE_ENTRY. |
These symbols return integer values that denote a call frame on the call stack. Call frame 0 denotes the routine at the top of the stack, where execution is suspended. Call frame 1 denotes the calling routine, and so on.
For example, the following command specifies that the debugger search for symbols starting with the scope denoted by the next routine down the call stack (rather than starting with the routine at the top of the call stack):
DBG> SET SCOPE/CURRENT %NEXT_SCOPE_ENTRY |
On VAX processors, you can use the debugger with programs written in the following DEC languages:
Ada | BASIC | BLISS | C |
C++ | COBOL | DIBOL | Fortran |
MACRO-32 | Pascal | PL/I | RPG II |
SCAN |
On Alpha processors, you can use the debugger with programs written in the following DEC languages:
Ada | BASIC | BLISS | C |
C++ | COBOL | Fortran | MACRO-32 1 |
MACRO-64 | Pascal | PL/I |
The manual describes debugging techniques that are common to most of
the supported languages. The following topics provide further
information that is specific to each language.
C.1 Overview
The debugger recognizes the syntax, data typing, and scoping rules of each language. It also recognizes each language's operators and expression syntax. Therefore, when using debugger commands you can specify variables and other program entities as you might in the source code of the program. You can also compute the value of a source-language expression using the syntax of that language.
The manual describes debugging techniques that are common to most of the supported languages. The help topics provide further information specific to each language:
For more information about language-specific debugger support, refer to the documentation furnished with a particular language.
If your program is written in more than one language, you can change the debugging context from one language to another during a debugging session. Use the SET LANGUAGE command with the keyword corresponding to your language choice.
On VAX processors, you can specify one of the following keywords:
ADA | BASIC | BLISS | C |
C++ | COBOL | DIBOL | FORTRAN |
MACRO | PASCAL | PLI | RPG |
SCAN | UNKNOWN |
On Alpha processors, you can specify one of the following keywords:
ADA | AMACRO | BASIC | BLISS |
C | C++ | COBOL | FORTRAN |
MACRO | MACRO64 | PASCAL | UNKNOWN |
When you are debugging a program written in an unsupported language,
enter the SET LANGUAGE UNKNOWN command. To maximize the usability of
the debugger with unsupported languages, this setting causes the
debugger to accept a large set of data formats and operators, including
some that might be specific to only a few supported languages. For
information about the operators and constructs that are recognized when
the language is set to UNKNOWN, type Help Language_UNKNOWN.
C.2 Ada
The following subtopics describe debugger support for Ada. For
information specific to Ada tasking programs, see also Chapter 17.
C.2.1 Ada Names and Symbols
The following subtopics describe debugger support for Ada names and symbols, including predefined attributes.
Note that parts of names may be language expressions---for example, attributes such as 'FIRST or 'POS. This affects how you use the EXAMINE, EVALUATE, and DEPOSIT commands with such names. For examples of enumeration types, type Help Specifying_Attributes_with_Enumeration_Types.
C.2.1.1 Ada Names
Supported Ada names follow:
Kind of Name | Debugger Support |
---|---|
Lexical elements |
Full support for Ada rules for the syntax of identifiers.
Function designators that are operator symbols (for example, + and *) rather than identifiers must be prefixed with %NAME. Also, the operator symbol must be enclosed in quotation marks. Full support for Ada rules for numeric literals, character literals, string literals, and reserved words. The debugger accepts signed integer literals in the range --2147483648 to 2147483647. Depending on context and architecture, the debugger interprets floating-point types as F_floating, D_floating, G_floating, H_floating, S_floating, or T_floating. |
Indexed components | Full support. |
Slices |
You can examine and evaluate an entire slice or an indexed component of
a slice.
You can deposit only to an indexed component of a slice. You cannot deposit an entire slice. |
Selected components | Full support, including use of the keyword all in .all. |
Literals | Full support, including the keyword null. |
Boolean symbols | Full support (TRUE, FALSE). |
Aggregates | You can examine the entire record and array objects with the EXAMINE command. You can deposit a value in a component of an array or record. You cannot use the DEPOSIT command with aggregates, except to deposit character string values. |
Supported Ada predefined attributes follow. Note that the debugger SHOW SYMBOL/TYPE command provides the same information that is provided by the P'FIRST, P'LAST, P'LENGTH, P'SIZE, and P'CONSTRAINED attributes.
Attribute | Debugger Support |
---|---|
P'CONSTRAINED | For a prefix P that denotes a record object with discriminants. The value of P'CONSTRAINED reflects the current state of P (constrained or unconstrained). |
P'FIRST | For a prefix P that denotes an enumeration type or a subtype of an enumeration type. Yields the lower bound of P. |
P'FIRST | For a prefix P that is appropriate for an array type, or that denotes a constrained array subtype. Yields the lower bound of the first index range. |
P'FIRST(N) | For a prefix P that is appropriate for an array type, or that denotes a constrained array subtype. Yields the lower bound of the Nth index range. |
P'LAST | For a prefix P that denotes an enumeration type, or a subtype of an enumeration type. Yields the upper bound of P. |
P'LAST | For a prefix P that is appropriate for an array type, or that denotes a constrained array subtype. Yields the upper bound of the first index range. |
P'LAST(N) | For a prefix P that is appropriate for an array type, or that denotes a constrained array subtype. Yields the upper bound of the Nth index range. |
P'LENGTH | For a prefix P that is appropriate for an array type, or that denotes a constrained array subtype. Yields the number of values of the first index range (zero for a null range). |
P'LENGTH(N) | For a prefix P that is appropriate for an array type, or that denotes a constrained array subtype. Yields the number of values of the Nth index range (zero for a null range). |
P'POS(X) | For a prefix P that denotes an enumeration type or a subtype of an enumeration type. Yields the position number of the value X. The first position is 0. |
P'PRED(X) | For a prefix P that denotes an enumeration type or a subtype of an enumeration type. Yields the value of type P which has a position number one less than that of X. |
P'SIZE | For a prefix P that denotes an object. Yields the number of bits allocated to hold the object. |
P'SUCC(X) | For a prefix P that denotes an enumeration type or a subtype of an enumeration type. Yields the value of type P which has a position number one more than that of X. |
P'VAL(N) | For a prefix P that denotes an enumeration type or a subtype of an enumeration type. Yields the value of type P which has the position number N. The first position is 0. |
Consider the following declarations:
type DAY is (MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY,SUNDAY); MY_DAY : DAY; |
The following examples show the use of attributes with enumeration types. Note that you cannot use the EXAMINE command to determine the value of attributes, because attributes are not variable names. You must use the EVALUATE command instead. For the same reason, attributes can appear only on the right of the := operator in a DEPOSIT command.
DBG> EVALUATE DAY'FIRST MON DBG> EVALUATE DAY'POS(WEDNESDAY) 2 DBG> EVALUATE DAY'VAL(4) FRI DBG> DEPOSIT MY_DAY := TUESDAY DBG> EVALUATE DAY'SUCC(MY_DAY) WED DBG> DEPOSIT . := DAY'PRED(MY_DAY) DBG> EXAMINE . EXAMPLE.MY_DAY: MONDAY DBG> EVALUATE DAY'PRED(MY_DAY) %DEBUG-W-ILLENUMVAL, enumeration value out of legal range |
Consider the following declarations:
type MASK is (DEC,FIX,EXP); type CODE is (FIX,CLA,DEC); MY_MASK : MASK; MY_CODE : CODE; |
In the following example, the qualified expression CODE'(FIX) resolves the overloaded enumeration literal FIX, which belongs to both type CODE and type MASK:
DBG> DEPOSIT MY_CODE := FIX %DEBUG-W-NOUNIQUE, symbol 'FIX' is not unique DBG> SHOW SYMBOL/TYPE FIX data EXAMPLE.FIX enumeration type (CODE, 3 elements), size: 1 byte data EXAMPLE.FIX enumeration type (MASK, 3 elements), size: 1 byte DBG> DEPOSIT MY_CODE := CODE'(FIX) DBG> EXAMINE MY_CODE EXAMPLE.MY_CODE: FIX |
The following sections describe debugger support for Ada operators and
language expressions.
C.2.2.1 Operators in Language Expressions
Supported Ada operators in language expressions include:
Kind | Symbol | Function |
---|---|---|
Prefix | + | Unary plus (identity) |
Prefix | - | Unary minus (negation) |
Infix | + | Addition |
Infix | - | Subtraction |
Infix | * | Multiplication |
Infix | / | Division |
Infix | MOD | Modulus |
Infix | REM | Remainder |
Infix | ** | Exponentiation (VAX specific) |
Prefix | ABS | Absolute value |
Infix | & | Concatenation (only string types) |
Infix | = | Equality (only scalar and string types) |
Infix | /= | Inequality (only scalar and string types) |
Infix | > | Greater than (only scalar and string types) |
Infix | >= | Greater than or equal (only scalar and string types) |
Infix | < | Less than (only scalar and string types) |
Infix | <= | Less than or equal (only scalar and string types) |
Prefix | NOT | Logical NOT |
Infix | AND | Logical AND (not for bit arrays) |
Infix | OR | Logical OR (not for bit arrays) |
Infix | XOR | Logical exclusive OR (not for bit arrays) |
The debugger does not support the following items:
Supported Ada expressions include:
Kind of Expression | Debugger Support |
---|---|
Type conversions |
No support for any of the
explicit type conversions specified in Ada. However, the
debugger performs certain
implicit type conversions between numeric types during the
evaluation of expressions.
The debugger converts lower-precision types to higher-precision types before evaluating expressions involving types of different precision:
|
Subtypes | Full support. Note that the debugger denotes subtypes and types that have range constraints as "subrange" types. |
Qualified expressions | Supported as required to resolve overloaded enumeration literals (literals that have the same identifier but belong to different enumeration types). The debugger does not support qualified expressions for any other purpose. |
Allocators | No support for any operations with allocators. |
Universal expressions | No support. |
C.2.3 Data Types
Supported Ada data types follow:
Ada Data Type | Operating System Data Type Name |
---|---|
INTEGER | Longword Integer (L) |
SHORT_INTEGER | Word Integer (W) |
SHORT_SHORT_INTEGER | Byte Integer (B) |
SYSTEM.UNSIGNED_QUADWORD | Quadword Unsigned (QU) |
SYSTEM.UNSIGNED_LONGWORD | Longword Unsigned (LU) |
SYSTEM.UNSIGNED_WORD | Word Unsigned (WU) |
SYSTEM.UNSIGNED_BYTE | Byte Unsigned (BU) |
FLOAT | F_Floating (F) |
SYSTEM.F_FLOAT | F_Floating (F) |
SYSTEM.D_FLOAT | D_Floating (D) |
LONG_FLOAT |
D_Floating (D), if pragma LONG_FLOAT (D_FLOAT) is in effect.
G_Floating (G), if pragma LONG_FLOAT (G_FLOAT) is in effect. |
SYSTEM.G_FLOAT | G_Floating (G) |
SYSTEM.H_FLOAT
(VAX specific) |
H_Floating (H) |
LONG_LONG_FLOAT
(VAX specific) |
H_Floating (H) |
IEEE_SINGLE_FLOAT
(Alpha specific) |
S_Floating (FS) |
IEEE_DOUBLE_FLOAT
(Alpha specific) |
T_Floating (FT) |
Fixed | (None) |
STRING | ASCII Text (T) |
BOOLEAN | Aligned Bit String (V) |
BOOLEAN | Unaligned Bit String (VU) |
Enumeration | For any enumeration type whose value fits into an unsigned byte or word: Byte Unsigned (BU) or Word Unsigned (WU), respectively. Otherwise: No corresponding operating system data type. |
Arrays | (None) |
Records | (None) |
Access (pointers) | (None) |
Tasks | (None) |
Previous | Next | Contents | Index |
Copyright © Compaq Computer Corporation 1998. All rights reserved. Legal |
4538PRO_066.HTML
|