5.4.2. Attaching macros to breakpoints

RealView Debugger includes a macro facility that enables you to create macros containing complex procedures that are then executed on your host workstation. You can attach a macro to a breakpoint so that it is executed when the breakpoint triggers. The macro can return values that determine whether program execution continues or stops.

RealView Debugger recognizes several predefined macros containing commonly used functions. These macros can also be attached to breakpoints. However, if you are attaching a macro that you create yourself, for example the tutorial() macro created in Using macros, then this must be open in RealView Debugger.

To open a macro ready to attach it to a breakpoint:

To attach a macro to a breakpoint:

  1. Select Debug → Simple Breakpoints → Address/Data... to display the Set Address/Data Break/Tracepoint dialog box.

  2. Enter the location of the breakpoint, for example 0x8704.

  3. Click the New button in the Qualifiers group to display the New Qualifiers menu, shown in Figure 5.9.

  4. Select the option User Macro... to display the data entry prompt where you enter the macro name, shown in Figure 5.17.

    Figure 5.17. Breakpoint macro entry prompt

    Breakpoint macro entry prompt

    This predefined macro displays a message box to halt execution if the Yes key is pressed.

  5. Click Set to confirm your entry.

  6. The Set Address/Data Break/Tracepoint dialog box now contains the macro in the Qualifiers group for the conditional breakpoint, shown in Figure 5.18.

    Figure 5.18. Set breakpoint with macro attached

    Set breakpoint with macro attached
  7. Click OK to confirm the breakpoint settings and so close the dialog box.

  8. Click Go to execute the program and trigger the breakpoint.

Note

Execution-type commands are not valid within a breakpoint macro. See Chapter 10 Working with Macros for full details.

Copyright © 2003, 2004 ARM Limited. All rights reserved.ARM DUI 0234B
Non-Confidential