10.1.4. Calling macros

Macros are called from the RealView Debugger command line. The call consists of the macro name followed by a set of parentheses containing the macro arguments, separated by commas. Macro names are case sensitive and must be entered as shown in the definition. The macro arguments are converted to the types specified in the macro definition. If RealView Debugger cannot convert the arguments it generates an error message.

Examples of macro calls are:

mytext(var)

Calls the macro named mytext with the argument var.

count(7)

Calls the macro named count with the parameter 7.

You can define a macro with a name that is identical to a command or keyword used by RealView Debugger. You can then use the macro name in an expression and submit it on the command line where it is interpreted correctly.

If, however, you submit the macro name as a command, RealView Debugger cannot identify it as a macro. To overcome this, use the prefix MACRO when entering macro names that might conflict with RealView Debugger keywords or command names:

MACRO macro_name()

Macros take higher precedence than target functions. If a target function and a macro have the same name, the macro is executed unless the target function is qualified. For example, strcpy is a predefined debugger macro, while PROG\strcpy is a function within the module PROG. The predefined macro is referenced as strcpy(dest,src), while PROG\strcpy(dest,src) refers to the function within PROG.

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