[an error occurred while processing this directive]
![]() |
![]() HP OpenVMS Systems Documentation |
![]() |
HP OpenVMS Debugger Manual
C.2.9 Predefined BreakpointsWhen 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.2.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.
Whenever an exception is raised, the debugger sets the following built-in symbols. You can use them to qualify exception breakpoints or tracepoints so that they trigger only on certain exceptions.
C.2.10.3 Monitoring Handled Exceptions and Exception HandlersThe SET BREAK/EVENT and SET TRACE/EVENT commands let you set breakpoints and tracepoints on exceptions that are about to be handled by Ada exception handlers. These commands let you observe the execution of each Ada exception handler that gains control. You can specify two event names with these commands:
For example, the following command sets a breakpoint that triggers whenever an exception is about to be handled by an Ada exception handler:
When the breakpoint triggers, the debugger identifies the exception that is about to be handled and the exception handler that is about to be executed. You can then use that information to set a breakpoint on a particular handler, or you can enter the GO command, and see which Ada handler next attempts to handle the exception. For example:
C.2.11 Examining and Manipulating DataWhen examining and manipulating data, note the following considerations:
In most cases, the debugger enables you to specify variables and
expressions in debugger commands exactly as you would specify them in
the source code of the program, including use of qualified expressions.
The following subtopics discuss some additional points about debugger
support for records and access types.
Note the following points about debugger support for records:
C.2.11.2 Access TypesNote the following points about debugger support for access types:
The following example shows the debugger support for incomplete types. Consider the following declarations:
The debugger does not have complete information about the type T, so
you cannot manipulate the variable VAR. However, the debugger does have
information about objects declared in the package body P. Thus, you can
manipulate the variables T_PTR and T_REC.
The names of Ada debugger modules are the same as the names of the corresponding compilation units, with the following provision. To eliminate ambiguity, an underscore character (_) is appended to a specification name to distinguish it from its body name. For example, TEST (body), TEST_ (specification). To determine the exact names of the modules in your program, use the SHOW MODULE command. In most cases when you specify a path name, the debugger can distinguish body names and specification names from the context. Therefore, use this naming convention only if needed to resolve an ambiguity. When the debugger language is set to Ada, the debugger generally constructs pathnames that follow the Ada rules, using selected component notation to separate path name elements (with other languages, a backslash is used to separate elements). For example:
The maximum length that you can specify for a subunit path name (expanded name) is 247 characters. When a use clause makes a symbol declared in a package directly visible outside the package, you do not need to specify an expanded name (package-name.symbol) to refer to the symbol, either in the program itself or in debugger commands. The SHOW SYMBOL/USE_CLAUSE command identifies any package (library or otherwise) that a specified block, subprogram, or package mentions in a use clause. If the entity specified is a package (library or otherwise), the command also identifies any block, subprogram, package, and so on, that names the specified module in a use clause. For example:
If a label has been assigned to a loop statement or
declare block in the source code, the debugger
displays the label; otherwise, the debugger displays LOOP$n
for a loop statement or BLOCK$n for a declare block, where
n is the line number at which the statement or block begins.
For Ada programs, when you do not specify a path name (including an Ada expanded name), the debugger searches the run-time symbol table as follows.
C.2.14 Setting ModulesWhen you or the debugger sets an Ada module, by default the debugger also sets any "related" module (that is, any module whose symbols should be visible within the module being set). Such modules are related to the one being set through either a with-clause or a subunit relationship. Related module setting takes place as follows. If M1 is the module that is being set, then the following modules are considered related and are also set:
If debugger performance becomes a problem as more modules are set, use the SET MODE NODYNAMIC command, which disables related module setting as well as dynamic module setting. You must then set individual modules explicitly with the SET MODULE command. By default, the SET MODULE command sets related modules simultaneously with the module specified in the command. The SET MODULE/NORELATED command sets only the modules you specify explicitly. However, if you use SET MODULE/NORELATED, you may find that a symbol that is declared in another unit and that should be visible at the point of execution is no longer visible or that a symbol which should be hidden by a redeclaration of that same symbol is now visible. The CANCEL MODULE/NORELATED command deletes from the RST only the modules you specify explicitly. This command, which is the default, deletes related modules in a manner consistent with the intent of Ada's scope and visibility rules. The exact effect depends on module relationships.
The distinction between related and directly related for subunits is
analogous to that for library packages.
Modules for package bodies are not automatically set by the debugger.
You may need to set the modules for library package bodies yourself so
that you can debug the package body or debug subprograms declared in
the corresponding package specification.
When you encounter overloaded names and symbols, the debugger issues a message like the following:
If the overloaded symbol is an enumeration literal, you can use qualified expressions to resolve the overloadings. If the overloaded symbol represents a subprogram or task accept statement, you can use the unique name generated by the compiler for the debugger. The compiler always generates unique names for subprograms declared in library package specifications, because the names might later be overloaded in the package body. Unique names are generated for task accept statements and subprograms declared in other places only if the task accept statements or subprograms are actually overloaded.
Overloaded task accept statement names and subprogram names are
distinguished by a suffix consisting of two underscores followed by an
integer that uniquely identifies the given symbol. You must use the
unique naming notation in debugger commands to uniquely specify a
subprogram whose name is overloaded. However, if there is no ambiguity,
you do not need to use the unique name, even though one was generated.
With Ada programs, you can use the CALL command reliably only with a subprogram that has been exported. An exported subprogram must be a library subprogram or must be declared in the outermost declarative part of a library package. The CALL command does not check whether or not the subprogram can be exported, nor does it check the parameter-passing mechanisms that you specify. Note that you cannot use the CALL command to modify the value of a parameter.
A CALL command may result in a deadlock if it is entered when the Ada
run-time library is executing. The run-time library routines acquire
and release internal locks that allow the routines to operate in a
tasking environment. Deadlock can result if a subprogram called from
the CALL command requires a resource that has been locked by an
executing run-time library routine. To avoid this situation in a
nontasking program, enter the CALL command immediately before or after
an Ada statement has been executed. However, this approach is not
sufficient to assure that deadlock will not occur in a tasking program,
as some other task may be executing a run-time library routine at the
time of the call. If you must use the CALL command in a tasking
program, you can avoid deadlock if the called subprogram does not do
any tasking or input-output operations.
The following subtopics describe debugger support for BASIC.
Supported BASIC operators in language expressions include:
|