hp.com home products and services support and drivers solutions how to buy
cd-rom home
End of Jump to page title
HP OpenVMS systems
documentation

Jump to content


HP OpenVMS Debugger Manual

HP OpenVMS Debugger Manual


Previous Contents Index

C.3.2 Constructs in Language and Address Expressions

Supported constructs in language and address expressions for BASIC follow:
Symbol Construct
( ) Subscripting
:: Record component selection

C.3.3 Data Types

Supported BASIC data types follow:
BASIC Data Type Operating System Data Type Name
BYTE Byte Integer (B)
WORD Word Integer (W)
LONG Longword Integer (L)
SINGLE F_Floating (F)
DOUBLE D_Floating (D)
GFLOAT G_Floating (G)
HFLOAT (VAX specific) H_Floating (H)
DECIMAL Packed Decimal (P)
STRING ASCII Text (T)
RFA (None)
RECORD (None)
Arrays (None)

C.3.4 Compiling for Debugging

If you make changes to a program in the BASIC environment and attempt to compile the program with the /DEBUG qualifier without first saving or replacing the program, BASIC signals the error "Unsaved changes, no source line debugging available." To avoid this problem, save or replace the program, and then recompile the program with the /DEBUG qualifier.

C.3.5 Constants

BASIC constants of the form [radix]"numeric-string"[type] (such as "12.34"GFLOAT) or the form n% (such as 25% for integer 25) are not supported in debugger expressions.

C.3.6 Evaluating Expressions

Expressions that overflow in the BASIC language do not necessarily overflow when evaluated by the debugger. The debugger tries to compute a numerically correct result, even when the BASIC rules call for overflows. This difference is particularly likely to affect DECIMAL computations.

C.3.7 Line Numbers

The sequential line numbers that you refer to in a debugging session and that are displayed in a source code display are those generated by the compiler. When a BASIC program includes or appends code from another file, the included lines of code are also numbered in sequence by the compiler.

C.3.8 Stepping into Routines

The STEP/INTO command is useful for examining external functions. However, if you use this command to stop execution at an internal subroutine or a DEF, the debugger initially steps into run-time library (RTL) routines, providing you with no useful information. In the following example, execution is paused at line 8, at a call to Print_routine:


    ...
->  8  GOSUB Print_routine 
    9  STOP 
    ...
   20  Print_routine: 
   21    IF Competition = Done 
   22      THEN PRINT "The winning ticket is #";Winning_ticket 
   23      ELSE PRINT "The game goes on." 
   24    END IF 
   25  RETURN 

A STEP/INTO command would cause the debugger to step into the relevant RTL code and would inform you that no source lines are available for display. On the other hand, a STEP command alone would cause the debugger to proceed directly to source line 9, past the call to Print_routine. To examine the source code of subroutines or DEF functions, set a breakpoint on the routine label (for example, enter the SET BREAK PRINT_ROUTINE command). You can then suspend execution exactly at the start of the routine (line 20, in this example) and then step directly into the code.

C.3.9 Symbolic References

All variable and label names within a single BASIC program must be unique. Otherwise the debugger cannot resolve the symbol ambiguity.

C.4 BLISS

The following subtopics describe debugger support for BLISS.

C.4.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

C.4.2 Constructs in Language and Address Expressions

Supported constructs in language and address expressions for BLISS follow:
Symbol Construct
[ ] Subscripting
[fldname] Field selection
<p,s,e> Bit field selection

C.4.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 I64 specific) Quadword (Q)
BYTE UNSIGNED Byte Unsigned (BU)
WORD UNSIGNED Word Unsigned (WU)
LONG UNSIGNED Longword Unsigned (LU)
QUAD UNSIGNED (Alpha and I64 specific) Quadword Unsigned (QU)
VECTOR (None)
BITVECTOR (None)
BLOCK (None)
BLOCKVECTOR (None)
REF VECTOR (None)
REF BITVECTOR (None)
REF BLOCK (None)
REF BLOCKVECTOR (None)

C.5 C

The following subtopics describe debugger support for C.

C.5.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.5.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.5.3 Data Types

Supported C data types follow:
C Data Type Operating System Data Type Name
__int64 (Alpha and I64 specific) Quadword Integer (Q)
unsigned __int64 (Alpha specific) Quadword Unsigned (QU)
__int32 (Alpha and I64 specific) Longword Integer (L)
unsigned __int32 (Alpha and I64 specific) Longword Unsigned (LU)
int Longword Integer (L)
unsigned int Longword Unsigned (LU)
__int16 (Alpha and I64 specific) Word Integer (W)
unsigned __int16 (Alpha and I64 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 I64 specific) F_Floating (F)
double D_Floating (D)
double G_Floating (G)
__g_float (Alpha and I64 specific) G_Floating (G)
float (Alpha and I64 specific) IEEE S_Floating (FS)
__s_float (Alpha and I64 specific) IEEE S_Floating (FS)
double (Alpha and I64 specific) IEEE T_Floating (FT)
__t_float (Alpha and I64 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.5.4 Case Sensitivity

Symbol names are case sensitive for language C, meaning that uppercase and lowercase letters are treated as different characters.

C.5.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.5.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

C.5.7 Arrays

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.5.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"


Previous Next Contents Index