12.11.2. Using a macro as an argument to a break command

You can optionally specify a macro as an argument at the end of a break command. Any macro that is specified in this way is treated as being specified last in the command qualifier list. For example:

breakinstruction,passcount:5,message:{"Actions performed"} \DHRY_1\#153:0 ;viewSymbol()

This command gives the same behavior where the command qualifiers are in the following order (see Table 12.1):

,passcount:5,macro:{viewSymbol()},message:{"Actions performed"}

Because a macro argument is treated last in the command qualifier list, if you also specify a macro as a command qualifier, then execution of the macro argument depends on the result returned by the macro qualifier. For example, you might define a second macro, such as:

define /R int viewValue()
{
  $printf "Int_1_Loc: %d", Int_1_Loc$;
  return (0); //   0 - stop execution at the breakpoint
              // >=1 - continue execution
}
.

Specify this macro as a command argument, and the viewSymbol() macro as a command qualifier, for example:

breakinstruction,passcount:5,macro:{viewSymbol()},message:{"Actions performed"} (I A)\DHRY_1\#153:2 ;viewValue()

The viewValue() macro runs only if viewSymbol() returns a value of zero. In addition, if viewValue() returns a nonzero value, then the Actions performed message is not displayed, and the breakpoint details are not recorded.

See also

Copyright © 2002-2009 ARM Limited. All rights reserved.ARM DUI 0153K
Non-Confidential