10.1.6. Using macros with breakpoints

When you set a breakpoint, you can also associate a macro with that breakpoint for complex break conditions. You can also attach predefined macros to breakpoints, for example by using the context menu option Set BreakIf... from the Src tab.

In this way you can test your program variables and decide whether execution stops or continues after the breakpoint has been triggered. When you have attached a macro to a breakpoint it can be executed every time the breakpoint is triggered.

You can use conditional statements in your macro to change the execution path when the breakpoint is triggered depending on variables on the debug target system or on the host workstation. This enables you to control program execution during your debugging session or when there is no user intervention. You can also use high-level expressions in macros. Combining these conditional statements and expressions enables you to patch your source program, see Source patching with macros.

Breakpoint macros can be used to fill out stubs, such as I/O handling, and also to simulate complex hardware.

For an example of attaching a macro to a breakpoint and using it to control program execution see Attaching macros to breakpoints.

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