16.5.1. Editing the example tutorial() macro

To edit the tutorial() macro:

  1. Make sure you have:

    1. Created the tutorial() macro as described in Creating a macro.

    2. Loaded the macro.

  2. Select Tools → Add/Edit Debugger Macros... from the Code window main menu to open the Add/Edit Macros dialog box.

  3. Select tutorial from the Existing Macros display list.

  4. Click Show to see the contents of the macro.

  5. Change the macro name and arguments to:

    /R int tutorial(var1,var2,var3)


    The /R (replace) switch must be included before the macro name because the macro is already defined in the symbol table.

  6. 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;
  7. Click Update to update the macro definition in the symbol table.

  8. 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.

  9. Click No to replace the macro definition in the existing script file.

  10. Click Close to close the Add/Edit Macros dialog box.

Testing the macro

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

See also

Copyright © 2002-2011 ARM. All rights reserved.ARM DUI 0153N