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

C.2.1.2 Predefined Attributes

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.

C.2.1.2.1 Specifying Attributes with Enumeration Types

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

C.2.1.2.2 Resolving Overloaded Enumeration Literals

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

C.2.2 Operators and Expressions

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:

C.2.2.2 Language Expressions

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:

  • If integer and floating-point types are mixed, the integer type is converted to floating-point type.
  • If integer and fixed-point types are mixed, the integer type is converted to fixed-point type.
  • If integer types of different sizes are mixed (for example, byte-integer and word-integer), the one with the smaller size is converted to the larger size.
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)

C.2.4 Compiling and Linking

The Ada predefined units in the ADA$PREDEFINED program library on your system have been compiled with the /NODEBUG qualifier. Before using the debugger to refer to names declared in the predefined units, you must first copy the predefined unit source files using the ACS EXTRACT SOURCE command. Then, you must compile the copies into the appropriate library with the /DEBUG qualifier, and relink the program with the /DEBUG qualifier.

If you use the /NODEBUG qualifier with one of the Ada compilation commands, only global symbol records are included in the modules for debugging. Global symbols in this case are names that the program exports to modules in other languages by means of the Ada export pragmas:

EXPORT_PROCEDURE
EXPORT_VALUED_PROCEDURE
EXPORT_FUNCTION
EXPORT_OBJECT
EXPORT_EXCEPTION
PSECT_OBJECT

The /DEBUG qualifier on the ACS LINK command causes the linker to include all debugging information in the closure of the specified unit in the executable image.

C.2.5 Source Display

Source code may not be available for display for the following reasons that are specific to Ada programs:

The following paragraphs explain how to control the display of source code with Ada programs.

If the compiler command's /COPY_SOURCE qualifier (the default) was in effect when you compiled your program, the debugger obtains the displayed Ada source code from the copied source files located in the program library where the program was originally compiled. If you compiled your program with the /NOCOPY_SOURCE qualifier, the debugger obtains the displayed Ada source code from the external source files associated with your program's compilation units.

The file specifications of the copied or external source files are embedded in the associated object files. For example, if you have used the ACS COPY UNIT command to copy units, or the DCL command COPY or BACKUP to copy an entire library, the debugger still searches the original program library for copied source files. If, after copying, the original units have been modified or the original library has been deleted, the debugger may not find the original copied source files. Similarly, if you have moved the external source files to another disk or directory, the debugger may not find them.

In such cases, use the SET SOURCE command to locate the correct files for source display. You can specify a search list of one or more program library or source code directories. For example (ADA$LIB is the logical name that the program library manager equates to the current program library):


DBG> SET SOURCE ADA$LIB,DISK:[SMITH.SHARE.ADALIB]

The SET SOURCE command does not affect the search list for the external source files that the debugger fetches when you use the debugger EDIT command. To tell the EDIT command where to look for your source files, use the SET SOURCE/EDIT command.

C.2.6 EDIT Command

With Ada programs, by default the debugger EDIT command fetches the external source file that was compiled to produce the compilation unit in which execution is currently paused. You do not edit the copied source file, in the program library, that the debugger uses for source display.

The file specifications of the source files you edit are embedded in the associated object files during compilation (unless you specify /NODEBUG). If some source files have been relocated after compilation, the debugger may not find them.

In such cases, you can use the debugger SET SOURCE/EDIT command to specify a search list of one or more directories where the debugger should look for source files. For example:


DBG> SET SOURCE/EDIT [],USER:[JONES.PROJ.SOURCES]

The SET SOURCE/EDIT command does not affect the search list for copied source files that the debugger uses for source display.

The SHOW SOURCE/EDIT command displays the source-file search list currently being used for the EDIT command. The CANCEL SOURCE/EDIT command cancels the source-file search list currently being used for the EDIT command and restores the default search mode.

C.2.7 GO and STEP Commands

Note the following points about using the GO and STEP commands with Ada programs:

C.2.8 Debugging Ada Library Packages

When an Ada main program (or a non-Ada main program that calls Ada code) is executed, initialization code is executed for the Ada run-time library and elaboration code for all library units that the program depends on. The elaboration code causes the library units to be elaborated in appropriate order before the main program is executed. Library specifications, bodies, and some of their subunits are also elaborated by this process.

The elaboration of library packages accomplishes the following operations:

When you bring an Ada program under debugger control, execution is paused initially before the initialization code is executed and before the elaboration of library units. For example:


DBG> RUN FORMS
Language: ADA, Module: FORMS 
Type GO to reach main program
DBG>

At that point, before typing GO to get to the start of the main program, you can step through and examine parts of the library packages by setting breakpoints at the package specifications or bodies you are interested in. You then use the GO command to get to the start of each package. To set a breakpoint on a package body, specify the package unit name with the SET BREAK command. To set a breakpoint on a package specification, specify the package unit name followed by a trailing underscore character (_).

Even if you have set a breakpoint on a package body, the break will not occur if the debugger module for that body is not set. If the module is not set, the break will occur at the package specification. This effect occurs because the debugger automatically sets modules for the specifications of packages named in with clauses; it does not automatically set modules for the associated package bodies (see Section C.2.14).

Also, to set a breakpoint on a subprogram declared in a package specification, you must set the module for the package body.

Note that the compiler generates unique names for subprograms declared in library packages that are or could be overloaded names. The debugger uses these unique names in its output, and requires them in commands where the names would otherwise be ambiguous. For more information on resolving overloaded names and symbols, see Section C.2.15.


Previous Next Contents Index