System Debug Reference Manual (32650-90888)

Chapter 2 41
User Interface
Procedure Name: Symbols
$nmdebug > mac formattable (entry=1) { ... }
Reference to macros as functions in expressions look exactly like references to predefined
functions:
$nmdebug > wl double (1)
$2
$nmdebug > wl double (double (1))
$4
$nmdebug >
Macro parameters may be defined as being either required or optional (as indicated by the
presence of default parameter values in the macro definition). When all of a macro's
parameters are optional and it is referenced as a function without any parameters, the
enclosing parentheses are optional:
$nmdebug > wl double ()
$2
$nmdebug > wl double
$2
$nmdebug >
When macros are used as commands, the parentheses surrounding the parameters may be
omitted:
$nmdebug > formattable 3
...
$nmdebug > formattable (3)
...
However, since macro command parameters may still be surrounded by parentheses as an
option, care must be used when the first parameter is an expression that begins with a
parenthesis of its own. In this case, the parenthesis is seen as the beginning of a
parenthesized list of command parameters, and not as belonging to the expression for the
first parameter. Thus, parameters surrounding the entire command list are required when
the first parameter starts with a parenthesis:
$nmdebug > formattable (current_entry + 1) * 2 /* wrong
$nmdebug > formattable ((current_entry + 1) * 2) /* right
Procedure Name: Symbols
Symbolic procedure names, which represent logical code addresses of the type class LCPTR,
may be used as operands in expressions. Thus, to determine the virtual address of the
procedure FOPEN, the WL command may be used as follows: