System Debug Reference Manual (32650-90888)
214 Chapter6
System Debug Command Specifications M-X
MACECHO
machelp = 'triples the parameter "input"'
{ return input *3
}
Assume that the macros listed above have been defined. A few of the macros use local
variables inefficiently, for the purpose of demonstration.
$nmdat > driver
$2
When a macro is called, the commands in the macro body are typically executed silently.
They are not displayed as they are being executed. In this example, macro driver executes
silently, and only the expected macro output is displayed.
$nmdat > macecho driver 1
$nmdat > driver
driver > loc one 1
driver > loc two 2
driver > wl min ( triple(two) inc(one) )
$2
In this example, echoing is enabled for macro driver. Then, when the macro is executed,
each command line in the macro body is displayed just prior to the execution of that line.
$nmdat > macecho min 1
$nmdat > driver
driver > loc one 1
driver > loc two 2
driver > wl min ( triple(two) inc(one) )
min > if parm1 < parm2 then return parm1 else return parm2
min > return parm2
$2
In this example, echoing is enabled for macro min, in addition to macro driver which
remains enabled from above. Command lines are displayed for both macros. Notice that
the command lines for macro min are indented, since it is called by macro driver. At each
nested level of macro invocation, an additional three blanks are added as indentation.
$nmdat > macecho @ 1
$nmdat > driver
driver > loc one 1
driver > loc two 2
driver > wl min ( triple(two) inc(one) )
triple > return input *3
inc > loc temp num
inc > loc temp temp + 1
inc > return temp
min > if parm1 < parm2 then return parm1 else return parm2
min > return parm2
$2
In this example, echoing is enabled for all ("@") currently defined macros. Each command
line, for every macro, is displayed before the command line is executed.
$nmdat > macecho @
$nmdat > driver
$2