![]() |
Software > OpenVMS Systems > Documentation > 82final > 4538 ![]() HP OpenVMS Systems Documentation |
![]() |
HP OpenVMS Debugger Manual
C.10.2 Constructs in Language and Address ExpressionsSupported constructs in language and address expressions for MACRO-32 follow:
The DST information generated by the MACRO-32 assembler treats a label that is followed by an assembler directive for storage allocation as an array variable whose name is the label. This enables you to use the array syntax of a high-level language when examining or manipulating such data. In the following example of MACRO-32 source code, the label LAB4 designates hexadecimal data stored in four words:
The debugger treats LAB4 as an array variable. For example, the following command displays the value stored in each element (word):
The following command displays the value stored in the fourth word (the first word is indexed as element "0"):
C.10.3 Data TypesMACRO-32 binds a data type to a label name according to the assembler directive that follows the label definition. Supported MACRO-32 directives follow:
C.10.4 MACRO-32 Compiler (AMACRO) (Alpha Only)Programmers who are porting applications written in MACRO-32 to Alpha systems use the MACRO-32 compiler (AMACRO). A debugging session for compiled MACRO-32 code is similar to that for assembled code. However, there are some important differences that are described in this section. For complete information on porting these applications, see the Porting VAX MACRO Code from OpenVMS VAX to OpenVMS Alpha manual. C.10.4.1 Code RelocationOne major difference is the fact that the code is compiled. On a VAX system, each MACRO-32 instruction is a single machine instruction. On an Alpha system, each MACRO-32 instruction may be compiled into many Alpha machine instructions. A major side effect of this difference is the relocation and rescheduling of code if you do not specify /NOOPTIMIZE in your compile command. After you have debugged your code, you can recompile without /NOOPTIMIZE to improve performance. C.10.4.2 Symbolic VariablesAnother major difference between debugging compiled code and debugging assembled code is a new concept to MACRO--2, the definition of symbolic variables for examining routine arguments. On VAX systems, when you were debugging a routine and wanted to examine the arguments, you would typically do something like the following:
or
On Alpha systems, the arguments do not reside in a vector in memory as they did on VAX systems. Furthermore, there is no AP register on Alpha systems. If you type EXAMINE @AP when debugging MACRO compiled code, the debugger reports that AP is an undefined symbol. In the compiled code, the arguments can reside in some combination of:
The compiler does not require that you read the generated code to locate the arguments. Instead, it provides $ARGn symbols that point to the correct argument locations. $ARG0 is the same as @AP+0 is on VAX systems, that is, the argument count. $ARG1 is the first argument, $ARG2 is the second argument, and so forth. These symbols are defined in CALL_ENTRY and JSB_ENTRY directives, but not in EXCEPTION_ENTRY directives. C.10.4.3 Locating Arguments Without $ARGn SymbolsThere may be additional arguments in your code for which the compiler did not generate a $ARGn symbol. The number of $ARGn symbols defined for a .CALL_ENTRY routine is the maximum number detected by the compiler (either by automatic detection or as specified by MAX_ARGS) or 16, whichever is less. For a .JSB_ENTRY routine, since the arguments are homed in the caller's stack frame and the compiler cannot detect the actual number, it always creates eight $ARGn symbols. In most cases, you can easily find any additional arguments, but in some cases you cannot. C.10.4.4 Arguments That Are Easy to LocateYou can easily find additional arguments if:
For example, you can examine arguments beyond the eighth argument in a JSB routine (where the argument list must be homed in the caller), as follows:
This example assumes that the caller detected at least ten arguments when homing the argument list. To find arguments beyond the last $ARGn symbol in a routine that did not home the arguments, proceed exactly as in the previous example except substitute EX .+8 for EX .+4. C.10.4.5 Arguments That Are Not Easy to LocateYou cannot easily find additional arguments if:
The only way to find the additional arguments in these cases is to examine the compiled machine code to determine where the arguments reside. Both of these problems are eliminated if MAX_ARGS is specified correctly for the maximum argument that you want to examine. C.10.4.6 Debugging Code with Floating-Point DataThe following list provides important information about debugging compiled MACRO-32 code with floating-point data on an Alpha system:
C.10.4.7 Debugging Code with Packed Decimal DataThe following list provides important information about debugging compiled MACRO-32 code with packed decimal data on an Alpha system:
C.11 MACRO-64 (Alpha Only)The following subtopics describe debugger support for MACRO-64. C.11.1 Operators in Language ExpressionsLanguage MACRO-64 does not have expressions in the same sense as high-level languages. Only assembly-time expressions and only a limited set of operators are accepted. To permit the MACRO-64 programmer to use expressions at debug-time as freely as in other languages, the debugger accepts a number of operators in MACRO-64 language expressions that are not found in MACRO-64 itself. In particular, the debugger accepts a complete set of comparison and Boolean operators modeled after BLISS. It also accepts the indirection operator and the normal arithmetic operators.
C.11.2 Constructs in Language and Address ExpressionsSupported constructs in language and address expressions for MACRO-64 follow:
C.11.3 Data TypesMACRO-64 binds a data type to a label name according to the data directive that follows the label definition. For example, in the following code fragment, the .LONG data directive directs MACRO-64 to bind the longword integer data type to labels V1, V2, and V3:
To confirm the type bound to V1, V2, and V3, issue a SHOW SYMBOL/TYPE command with a V* parameter. The following display results:
Supported MACRO-64 directives follow:
C.12 PascalThe following subtopics describe debugger support for Pascal.C.12.1 Operators in Language ExpressionsSupported Pascal operators in language expressions include:
The typecast operator (::) is not supported in language expressions. C.12.2 Constructs in Language and Address ExpressionsSupported constructs in language and address expressions for Pascal follow:
|