13.07.2015 Views

RealView Debugger User Guide - ARM Information Center

RealView Debugger User Guide - ARM Information Center

RealView Debugger User Guide - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Working with Macros9.1.1 Properties of macrosMacros can:• have return values• contain C expressions• contain certain C statements• have arguments• define macro local variables• use conditional statements• call other macros and predefined macros• be used in expressions, where they return values• reference target variables and registers• reference user-defined variables, in debugger or target memory• execute most debugger commands• be defined in a debugger include file.Macros cannot:• be recursive• define global variables• define static variables• define other macros.9.1.2 <strong>Debugger</strong> commands in macros<strong>RealView</strong> <strong>Debugger</strong> enables you to enter debugger commands on the command line, orwhen using the headless debugger, for example PRINTF or SETMEM.You can define a macro that contains a sequence of debugger commands. When used inthis way, the command must be enclosed by dollar signs ($), shown in Example 9-1.Example 9-1 Using debugger commands in macrossome_commandsdefine int registers(){some_commandsfor(macro_index = 0; macro_index < 6; macro_index++){macro_bin_str[macro_index + 8] = macro_cpsr_mode[macro_index +(6*macro_cpsr_key)];}<strong>ARM</strong> DUI 0153G Copyright © 2002-2005 <strong>ARM</strong> Limited. All rights reserved. 9-3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!