| |||
| Home > Controlling the Behavior of Breakpoints > Setting a breakpoint that depends on the result of a macro > Attaching a macro as a command qualifier | |||
To attach a macro to a breakpoint using the macro command
qualifier:
Either:
create a new hardware breakpoint (see Chapter 10 Setting Breakpoints), and leave the Create Breakpoint dialog box open
edit an existing hardware breakpoint (see Editing a breakpoint) to display the Edit Breakpoint dialog box
copy an existing hardware breakpoint (see Copying a breakpoint) to display the Copy Breakpoint dialog box.
Click More... on the breakpoint dialog box you are using to display the breakpoint behavior controls. An example is shown in Figure 11.14.
Click Add in the Conditions group.
The Add Condition dialog box is displayed, shown in Figure 11.15.
Select the User Macro condition.
Enter the macro name, including any arguments, that you want to run before the breakpoint is to activate.
For example, test_loop(5,10).
Click OK to close the Add Condition dialog box.
The condition is added to the breakpoint conditions list.
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.