12.9.1. Attaching a macro as a command qualifier

To attach a macro to a breakpoint using the macro command qualifier:

  1. Open the Create Breakpoint or Edit Breakpoint dialog box as appropriate.

  2. Click More... on the breakpoint dialog box you are using to display the breakpoint behavior controls. Figure 12.14 shows an example.

  3. Click Add in the Conditions group to open the Add Condition dialog box, shown in Figure 12.15.

  4. Select the User Macro condition.

  5. Enter the macro name, including any arguments, that you want to run before the breakpoint is to activate. For example, test_loop(5,10).

  6. Click OK to close the Add Condition dialog box.

    The condition is added to the breakpoint conditions list.

  7. Click OK to set the conditional breakpoint and close the breakpoint dialog box you are using.

    The breakpoint is identified by a yellow disc.

The following example shows a breakpoint command with a macro qualifier:

BREAKINSTRUCTION,macro:{test_loop(5,10)} DHRY_1\#149:1

Example 12.1 shows the test_loop macro. The macro checks when Run_Index in dhry_1.c of the Dhrystone example has values between user-specified values. If Run_Index has a value within the specified range, then execution stops at the breakpoint.

Example 12.1. Example test_loop macro

define /R int test_loop(begin,end)
int begin;
int end;
  if ((Run_Index >= begin) & (Run_Index < end))
    return 0; //stop execution
    return 1; //continue execution

See also

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