[an error occurred while processing this directive]
![]() |
![]() HP OpenVMS Systems Documentation |
![]() |
OpenVMS Debugger Manual
C.3.1.2 Predefined AttributesSupported 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.
C.3.1.2.1 Specifying Attributes with Enumeration TypesConsider the following declarations:
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.
C.3.1.2.2 Resolving Overloaded Enumeration LiteralsConsider the following declarations:
In the following example, the qualified expression CODE'(FIX) resolves the overloaded enumeration literal FIX, which belongs to both type CODE and type MASK:
C.3.2 Operators and Expressions
The following sections describe debugger support for Ada operators and
language expressions.
Supported Ada operators in language expressions include:
The debugger does not support the following items:
C.3.2.2 Language ExpressionsSupported Ada expressions include:
C.3.4 Compiling and LinkingThe 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
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.
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):
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.
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:
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.
Note the following points about using the GO and STEP commands with Ada programs:
C.3.8 Debugging Ada Library PackagesWhen 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:
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.3.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.3.15.
When you start the debugger with an Ada program (or a non-Ada program that calls Ada code), two breakpoints that are associated with Ada tasking exception events are automatically established. These breakpoints are established automatically during debugger initialization when the Ada run-time library is present. When you enter a SHOW BREAK command under these conditions, the following breakpoints are displayed:
C.3.10 Monitoring ExceptionsThe debugger recognizes three kinds of exceptions in Ada programs:
The following subtopics explain how to monitor such exceptions.
The SET BREAK/EXCEPTION command enables you to set a breakpoint on any exception or condition. This includes certain conditions that are signaled internally within the Ada run-time library. These conditions are an implementation mechanism; they do not represent program failures, and they cannot be handled by Ada exception handlers. If these conditions appear while you are debugging your program, you may want to consider specifying the kind of exceptions when setting breakpoints. The following example shows a tracepoint occurring for an Ada CONSTRAINT_ERROR exception as the result of a SET TRACE/EXCEPTION command:
In the next example, the SHOW CALLS command displays a traceback of the calls leading to the subprogram where the exception occurred or to which the exception was raised:
In this example, the condition SS$_INTDIV is raised at line 17 of the subprogram DIVIDE in the package SYSTEM_OPS. The example shows an important effect: some conditions (such as SS$_INTDIV) are treated as being equivalent to some Ada predefined exceptions. The matching of a condition and an Ada predefined exception is performed by the condition handler provided by Ada for any frame that includes an exception part. Therefore, when an exception breakpoint or tracepoint is triggered by a condition that has an equivalent Ada exception name, the message displays only the system condition code name, and not the name of the corresponding Ada exception.
|