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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Working with Macros9.2.4 Editing a macroTo edit the macro that you have created and retest it to verify the changes:1. Select Tools → Add/Edit <strong>Debugger</strong> Macros... to display the Add/Edit Macrosdialog. The Existing Macros display list shows the tutorial macro you createdand it is highlighted.2. Click Show to see the contents of the macro.3. Change the macro name to read:int tutorial(var1,var2,var3)4. In the Macro Entry Area change the variable definition to read:int var1;int var2;int var3;5. In the Macro Entry Area change the body of the macro to read:var1==var1++;$fprintf 250, "value=%d\n",var1$;$fprintf 250, "value=%d\n",var2$;$fprintf 250, "value=%d\n",var3$;This change increments var1 and displays the output of the macro in a windowinstead of the Output pane.6. In the Macro Entry Area add this line at the end of the macro:return(var1);This change causes the macro to return the value of the variable. If the value isnonzero, then <strong>RealView</strong> <strong>Debugger</strong> continues program execution after reportingthe result. If the value returned is zero, then execution stops.The macro now looks like the one shown in Figure 9-2 on page 9-12.<strong>ARM</strong> DUI 0153G Copyright © 2002-2005 <strong>ARM</strong> Limited. All rights reserved. 9-11

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

Saved successfully!

Ooh no, something went wrong!