|
|||||||||||
Technical Support Support Resources
Product Information |
µVISION DEBUGGER: Saving and Restoring the Program CounterInformation in this article applies to:
QUESTIONIn the µVision Debugger, I would like to save the program counter and restore it later. Is there a way to do this? ANSWERYes. You may create debugger functions that save and restore the program counter. The following example shows how to save the current program counter in a debugger variable: define long pc_stk func void pc_push (void) { pc_stk = $; printf ("Saving PC (%8.8LX)\n", pc_stk); } func void pc_pop (void) { $ = pc_stk; printf ("Restoring PC (%8.8LX)\n", pc_stk); } define button "Push PC" , "pc_push ()" define button "Pop PC" , "pc_pop ()" This code also creates two buttons in the toolbox that you can click. You may wish to extend this example to save more than one program counter location. To do that, you need to have an index and create multiple variables for the program counters. SEE ALSO
Last Reviewed: Thursday, January 14, 2021 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.