Previous | Contents | Index |
All variable and label names within a single BASIC program must be
unique. Otherwise the debugger cannot resolve the symbol ambiguity.
C.5 BLISS
The following subtopics describe debugger support for BLISS.
C.5.1 Operators in Language Expressions
Supported BLISS operators in language expressions include:
Kind | Symbol | Function |
---|---|---|
Prefix | . | Indirection |
Prefix | + | Unary plus |
Prefix | - | Unary minus (negation) |
Infix | + | Addition |
Infix | - | Subtraction |
Infix | * | Multiplication |
Infix | / | Division |
Infix | MOD | Remainder |
Infix | ^ | Left shift |
Infix | EQL | Equal to |
Infix | EQLU | Equal to |
Infix | EQLA | Equal to |
Infix | NEQ | Not equal to |
Infix | NEQU | Not equal to |
Infix | NEQA | Not equal to |
Infix | GTR | Greater than |
Infix | GTRU | Greater than unsigned |
Infix | GTRA | Greater than unsigned |
Infix | GEQ | Greater than or equal to |
Infix | GEQU | Greater than or equal to unsigned |
Infix | GEQA | Greater than or equal to unsigned |
Infix | LSS | Less than |
Infix | LSSU | Less than unsigned |
Infix | LSSA | Less than unsigned |
Infix | LEQ | Less than or equal to |
Infix | LEQU | Less than or equal to unsigned |
Infix | LEQA | Less than or equal to unsigned |
Prefix | NOT | Bit-wise NOT |
Infix | AND | Bit-wise AND |
Infix | OR | Bit-wise OR |
Infix | XOR | Bit-wise exclusive OR |
Infix | EQV | Bit-wise equivalence |
Supported constructs in language and address expressions for BLISS follow:
Symbol | Construct |
---|---|
[ ] | Subscripting |
[fldname] | Field selection |
<p,s,e> | Bit field selection |
C.5.3 Data Types
Supported BLISS data types follow:
BLISS Data Type | Operating System Data Type Name |
---|---|
BYTE | Byte Integer (B) |
WORD | Word Integer (W) |
LONG | Longword Integer (L) |
QUAD (Alpha and Integrity servers-specific) | Quadword (Q) |
BYTE UNSIGNED | Byte Unsigned (BU) |
WORD UNSIGNED | Word Unsigned (WU) |
LONG UNSIGNED | Longword Unsigned (LU) |
QUAD UNSIGNED (Alpha and Integrity servers-specific) | Quadword Unsigned (QU) |
VECTOR | (None) |
BITVECTOR | (None) |
BLOCK | (None) |
BLOCKVECTOR | (None) |
REF VECTOR | (None) |
REF BITVECTOR | (None) |
REF BLOCK | (None) |
REF BLOCKVECTOR | (None) |
The following subtopics describe debugger support for C.
C.6.1 Operators in Language Expressions
Supported C operators in language expressions include:
Kind | Symbol | Function |
---|---|---|
Prefix | * | Indirection |
Prefix | & | Address of |
Prefix | sizeof | size of |
Prefix | - | Unary minus (negation) |
Infix | + | Addition |
Infix | - | Subtraction |
Infix | * | Multiplication |
Infix | / | Division |
Infix | % | Remainder |
Infix | << | Left shift |
Infix | >> | Right shift |
Infix | == | Equal to |
Infix | != | Not equal to |
Infix | > | Greater than |
Infix | >= | Greater than or equal to |
Infix | < | Less than |
Infix | <= | Less than or equal to |
Prefix | ~ (tilde) | Bit-wise NOT |
Infix | & | Bit-wise AND |
Infix | | | Bit-wise OR |
Infix | ^ | Bit-wise exclusive OR |
Prefix | ! | Logical NOT |
Infix | && | Logical AND |
Infix | || | Logical OR |
Because the exclamation point (!) is an operator in C, it cannot be used as the comment delimiter. When the language is set to C, the debugger instead accepts /* as the comment delimiter. The comment continues to the end of the current line. (A matching */ is neither needed nor recognized.) To permit debugger log files to be used as debugger input, the debugger still recognizes an exclamation point (!) as a comment delimiter if it is the first nonspace character on a line.
The debugger accepts the prefix asterisk (*) as an indirection operator in both C language expressions and debugger address expressions. In address expressions, prefix "*" is synonymous to prefix "." or "@" when the language is set to C.
The debugger does not support any of the assignment operators in C (or
any other language) in order to prevent unintended modifications to the
program being debugged. Hence such operators as =, +=, -=, ++, and --
are not recognized. To alter the contents of a memory location, you
must use an explicit DEPOSIT command.
C.6.2 Constructs in Language and Address Expressions
Supported constructs in language and address expressions for C follow:
Symbol | Construct |
---|---|
[ ] | Subscripting |
. (period) | Structure component selection |
-> | Pointer dereferencing |
C.6.3 Data Types
Supported C data types follow:
C Data Type | Operating System Data Type Name |
---|---|
__int64 (Alpha and Integrity servers specific) | Quadword Integer (Q) |
unsigned __int64 (Alpha specific) | Quadword Unsigned (QU) |
__int32 (Alpha and Integrity servers specific) | Longword Integer (L) |
unsigned __int32 (Alpha and Integrity servers specific) | Longword Unsigned (LU) |
int | Longword Integer (L) |
unsigned int | Longword Unsigned (LU) |
__int16 (Alpha and Integrity servers specific) | Word Integer (W) |
unsigned __int16 (Alpha and Integrity servers specific) | Word Unsigned (WU) |
short int | Word Integer (W) |
unsigned short int | Word Unsigned (WU) |
char | Byte Integer (B) |
unsigned char | Byte Unsigned (BU) |
float | F_Floating (F) |
__f_float (Alpha and Integrity servers specific) | F_Floating (F) |
double | D_Floating (D) |
double | G_Floating (G) |
__g_float (Alpha and Integrity servers specific) | G_Floating (G) |
float (Alpha and Integrity servers specific) | IEEE S_Floating (FS) |
__s_float (Alpha and Integrity servers specific) | IEEE S_Floating (FS) |
double (Alpha and Integrity servers specific) | IEEE T_Floating (FT) |
__t_float (Alpha and Integrity servers specific) | IEEE T_Floating (FT) |
enum | (None) |
struct | (None) |
union | (None) |
Pointer Type | (None) |
Array Type | (None) |
Floating-point numbers of type float may be represented by F_Floating or IEEE S_Floating, depending on compiler switches.
Floating-point numbers of type double may be represented by IEEE
T_Floating, D_Floating, or G_Floating, depending on compiler switches.
C.6.4 Case Sensitivity
Symbol names are case sensitive for language C, meaning that uppercase
and lowercase letters are treated as different characters.
C.6.5 Static and Nonstatic Variables
Variables of the following storage classes are allocated statically: static, globaldef, globalref, and extern.
Variables of the following storage classes are allocated nonstatically
(on the stack or in registers): auto and register. Such variables can
be accessed only when their defining routine is active (on the call
stack).
C.6.6 Scalar Variables
You can specify scalar variables of any C type in debugger commands exactly as you would specify them in the source code of the program.
The following paragraphs provide additional information about char variables and pointers.
The char variables are interpreted by the debugger as byte integers, not ASCII characters. To display the contents of a char variable ch as a character, you must use the /ASCII qualifier:
DBG> EXAMINE/ASCII ch SCALARS\main\ch: "A" |
You also must use the /ASCII qualifier when depositing into a char variable, to translate the byte integer into its ASCII equivalent. For example:
DBG> DEPOSIT/ASCII ch = 'z' DBG> EXAMINE/ASCII ch SCALARS\main\ch: "z" |
The following example shows use of pointer syntax with the EXAMINE command. Assume the following declarations and assignments:
static long li = 790374270; static int *ptr = &li; |
DBG> EXAMINE *ptr *SCALARS\main\ptr: 790374270 |
The debugger handles C arrays as for most other languages. That is, you
can examine an entire array aggregate, a slice of an array, or an
individual array element, using array syntax (for example EXAMINE
arr[3]). And you can deposit into only one array element at a time.
C.6.8 Character Strings
Character strings are implemented in C as null-terminated ASCII strings (ASCIZ strings). To examine and deposit data in an entire string, use the /ASCIZ (or /AZ) qualifier so that the debugger can interpret the end of the string properly. You can examine and deposit individual characters in the string using the C array subscripting operators ([ ]). When you examine and deposit individual characters, use the /ASCII qualifier.
Assume the following declarations and assignments:
static char *s = "vaxie"; static char **t = &s; |
The EXAMINE/AZ command displays the contents of the character string pointed to by *s and **t:
DBG> EXAMINE/AZ *s *STRING\main\s: "vaxie" DBG> EXAMINE/AZ **t **STRING\main\t: "vaxie" |
The DEPOSIT/AZ command deposits a new ASCIZ string in the variable pointed to by *s . The EXAMINE/AZ command displays the new contents of the string:
DBG> DEPOSIT/AZ *s = "DEC C" DBG> EXAMINE/AZ *s, **t *STRING\main\s: "DEC C" **STRING\main\t: "DEC C" |
You can use array subscripting to examine individual characters in the string and deposit new ASCII values at specific locations within the string. When accessing individual members of a string, use the /ASCII qualifier. A subsequent EXAMINE/AZ command shows the entire string containing the deposited value:
DBG> EXAMINE/ASCII s[3] [3]: " " DBG> DEPOSIT/ASCII s[3] = "-" DBG> EXAMINE/AZ *s, **t *STRING\main\s: "VAX-C" **STRING\main\t: "VAX-C" |
You can examine structures in their entirety or on a member-by-member basis, and deposit data into structures one member at a time.
To reference members of a structure or union, use the usual C syntax for such references. That is, if variable p is a pointer to a structure, you can reference member y of that structure with the expression p ->y . If variable x refers to the base of the storage allocated for a structure, you can refer to a member of that structure with the x.y expression.
The debugger uses C type-checking rules to reference members of a structure or union. For example, in the case of x.y , y need not be a member of x ; it is treated as an offset with a type. When such a reference is ambiguous---when there is more than one structure with a member y ---the debugger attempts to resolve the reference according to the following rules. The same rules for resolving the ambiguity of a reference to a member of a structure or union apply to both x.y and p ->y .
You can always give a path name with the reference to x to narrow the scope that is used and to resolve the ambiguity. The same path name is used to look up both x and y .
C.7 C++ Version 5.5 and Later (Alpha and Integrity servers Only)
On Alpha and Integrity server systems, the OpenVMS debugger provides
enhanced support for debugging C++ modules compiled with the Version
5.5 compiler or later (Alpha and Integrity servers only).
The debugger supports the following C++ features:
The debugging examples in this section refer to the test program
contained in Example C-1, and are extracted from the debugging
session contained in Example C-2. The following subtopics describe
debugger support for C++.
C.7.1 Operators in Language Expressions
Supported C++ operators in language expressions follow:
Kind | Symbol | Function |
---|---|---|
Prefix | * | Indirection |
Prefix | & | Address of |
Prefix | sizeof | size of |
Prefix | -- | Unary minus (negation) |
Infix | + | Addition |
Infix | -- | Subtraction |
Infix | * | Multiplication |
Infix | / | Division |
Infix | % | Remainder |
Infix | << | Left shift |
Infix | >> | Right shift |
Infix | == | Equal to |
Infix | != | Not equal to |
Infix | > | Greater than |
Infix | >= | Greater than or equal to |
Infix | < | Less than |
Infix | <= | Less than or equal to |
Prefix | ~ (tilde) | Bit-wise NOT |
Infix | & | Bit-wise AND |
Infix | | | Bit-wise OR |
Infix | ^ | Bit-wise exclusive OR |
Prefix | ! | Logical NOT |
Infix | && | Logical AND |
Infix | || | Logical OR |
Because the exclamation point (!) is an operator, it cannot be used in C++ programs as a comment delimiter. However, to permit debugger log files to be used as debugger input, the debugger interprets ! as a comment delimiter when it is the first nonspace character on a line. In C++ language mode, the debugger also interprets /* or // as preceding a comment that continues to the end of the current line.
The debugger accepts the asterisk (*) prefix as an indirection operator in both C++ language expressions and debugger address expressions. In address expressions, the * prefix is synonymous with either the period (.) prefix or at sign (@) prefix when the debugger is in C++ language mode.
To prevent unintended modifications to the program being debugged, the debugger does not support any of the assignment operators in C++ (or any other language). Thus, such operators as =, +=, --=, ++, and -- are not recognized in debugger commands. To alter the contents of a memory location, you must use the debugger DEPOSIT command.
Previous | Next | Contents | Index |