User`s guide
How the MACRO Compiler Functions on Different Platforms
2.13 Debugging
2.13.2 Symbolic Variables for Routine Arguments
Another major difference between debugging compiled code and debugging
assembled code is a new concept to VAX MACRO, the definition of symbolic
variables for examining routine arguments. On OpenVMS VAX systems, when
you are debugging a routine and want to examine the arguments, you typically
do something like the following:
DBG> EXAMINE @AP ; to see the argument count
DBG> EXAMINE @AP+4 ; to examine the first arg
or
DBG> EXAMINE @AP ; to see arg count
DBG> EXAMINE .+4:.+20 ; to see first 5 args
On OpenVMS Alpha and OpenVMS I64 systems, the arguments do not reside
in a vector in memory as they do on OpenVMS VAX systems. Furthermore,
there is no AP register on OpenVMS Alpha and OpenVMS I64 systems. If you
type EXAMINE @AP when debugging VAX MACRO compiled code, the debugger
reports that AP is an undefined symbol.
In the compiled code, the arguments can reside in some combination of:
• Registers
• On the stack above the routine’s stack frame
• In the stack frame, if the argument list was homed (see Section 2.4) or if
there are calls out of the routine that would require the register arguments to
be saved
The compiler does not require that you figure out where the arguments are by
reading the generated code. Instead, it provides $ARGn symbols that point to the
correct argument locations. The $ARG0 symbol is the same as @AP+0 is on VAX
systems, that is, the argument count. The $ARG1 symbol 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.
2.13.3 Locating Arguments Without $ARGn Symbols
There 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). 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.
2.13.3.1 Additional Arguments That Are Easy to Locate
You can easily find additional arguments if:
• The argument list is not homed, and $ARGn symbols are defined to $ARG7
or higher on OpenVMS Alpha and $ARG9 or higher on OpenVMS I64. If
the argument list is not homed, the $ARGn symbols $ARG7 and above on
OpenVMS Alpha and $ARG9 and above on OpenVMS I64 always point
into the list of parameters passed as quadwords on the stack. Subsequent
arguments will be in quadwords following the last defined $ARGn symbol.
How the MACRO Compiler Functions on Different Platforms 2–33