1.8.1. Patching example to insert lines of source code

To insert a few lines of source code in your program:

  1. Define a macro containing the statements that you want to insert.

  2. Start a debugging session and set a breakpoint on the source line following the point where you want to insert the new lines.

  3. Attach your macro to this breakpoint.

  4. Run the program until execution stops at the breakpoint.

  5. The source statements in your macro are interpreted and executed. The macro completes.

  6. Program execution continues normally.

Note

Using a macro in this way might cause problems with compiler optimizations, for example the ordering of instructions might have been altered by the compiler.

See also

Copyright © 2002-2011 ARM. All rights reserved.ARM DUI 0175N
Non-ConfidentialID052111