16.6. Copying a macro

You can copy a macro if you want to create a new macro based on an existing macro.

The example in this procedure assumes that you have modified the tutorial() macro as described in Editing the example tutorial() macro.

You can use an existing macro to form the basis of a new macro:

  1. Select Tools → Add/Edit Debugger Macros... from the Code window main menu to open the Add/Edit Macros dialog box. The Existing Macros display list shows any macro you have previously created.

  2. Select the macro to be edited from the Existing Macros display list.

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

  4. Click Copy.

    This automatically adds an integer number to the end of the macro name in the Name field, starting at one. You can change the name, if required.

    For the macro created in Editing the example tutorial() macro, the name of the new macro becomes tutorial1(var1,var2,var3). Subsequent copies are numbered sequentially, for example, tutorial2(var1,var2,var3) and tutorial3(var1,var2,var3).

  5. In the Macro Entry Area change the body of the macro as required.

  6. Click Update to define the new macro definition in the symbol table.

    Note

    The updated macro is moved to the bottom of the Existing Macros list.

  7. View the Output view message, assuming that you do not change the default name:

    def int tutorial1(var1,var2,var3)
    
  8. Click Save to save the updated macro in the usual way.

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

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