11.8.1. Attaching a macro as a command qualifier

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

  1. Either:

  2. Click More... on the breakpoint dialog box you are using to display the breakpoint behavior controls. An example is shown in Figure 11.14.

  3. Click Add in the Conditions group.

    The Add Condition dialog box is displayed, shown in Figure 11.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 (see Unconditional and conditional breakpoints), and close the breakpoint dialog box you are using.

    The breakpoint is identified by a yellow disc (see Breakpoint icons and color coding).

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

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

The test_loop macro, shown in Example 11.1, checks when Run_Index in dhry_1.c of the Dhrystone example has values between user-specified values, and if it does, then execution stops at the breakpoint.

Example 11.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
  else
    return 1; //continue execution
}
.

Copyright © 2002-2006 ARM Limited. All rights reserved.ARM DUI 0153H
Non-Confidential