| |||
| Home > Using Macros for Debugging > Editing a macro > Editing the example tutorial() macro | |||
This example assumes that you have created the tutorial() macro
as described in Creating a macro.
To edit the tutorial() macro:
Select Tools ? Add/Edit Debugger Macros... from the Code window main menu.
The Add/Edit Macros dialog box is displayed.
Select tutorial from the Existing Macros display list.
Click Show to see the contents of the macro.
Change the macro name and arguments to
int tutorial(var1,var2,var3)
In the Macro Entry Area, change the macro definition to:
int var1;
int var2;
int var3;
{
$printf "value of var1=%d",var1$;
$printf "value of var2=%d",var2$;
$printf "value of var3=%d",var3$;
return var1+var2+var3;
}
Click Update to update the macro definition in the symbol table.
Click Save... to save the
updated macro in the same file containing the original definition
of tutorial().
This generates a prompt to enable you to Append or Replace the existing file.
Click No to replace the macro definition in the existing script file.
Click Close to close the Add/Edit Macros dialog.
To test the macro, enter:
> cexpression tutorial(1,2,3)
value of var1=1
value of var2=2
value of var3=3
Result is: 6 0x00000006