To Call A Macro When Stepping Through Programs - HP 68000 Series User Manual

Debugger/simulator
Table of Contents

Advertisement

Chapter 6: Using Macros and Command Files
Using Macros

To call a macro when stepping through programs

• Select Execution→Step→with Macro ....
Or:
• 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.
Example
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()
200
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$;
}

Advertisement

Table of Contents
loading

This manual is also suitable for:

B1466

Table of Contents