Chapter 6: Using Macros and Command Files
To call a macro when stepping through programs
• Select Execution→Step→with Macro ....
• Using the command line, enter:
Program Step With_Macro
Enter the name of the macro to be called, and press the < Return> key.
You can use the Program Step With_Macro command to execute a macro
after the step occurs. Calling a macro in this manner is useful in tracking
down subtle bugs.
If the function foo() was corrupting automatic variables index and ch on the
stack, the following macro and commands could be used to identify the line
where the corruption was occurring:
Debugger Macro Add void auto_check()
Program Run Until foo
Program Step With_Macro auto_check()
if ((index < 0 || index > 80) || (ch < 32 || ch > 126))
$Window Screen_On High_Level$;
$Expression Printf "Autos corrupted!!!\n"$;
$Expression Printf "index: %d ch: %c\n", index, ch$;