I am using Keil Micro Vision4 for ARM 9 Processor .the Local variables appears "Out of scope" How do i monitor the local variables
Note that 'Best suited' is something different if: - you want easiest debug - you want smallest code - you want fastest code - you want quick code generation
Most compiler defaults to something in-between.
Got it. Default may not be "Best For Debugging".
Check the Compiler Control String
-c --cpu Cortex-M3 -D__RTX -g -O0 --apcs=interwork -I C:\Keil\ARM\RV31\Inc -I C:\Keil\ARM\CMSIS\Include -I C:\Keil\ARM\Inc\NXP\LPC17xx -o ".\obj\*.o" --omf_browse
the Highlighted 2digit number displays the Optimization level. may not be set to '00' for default settings. In my keil, it was set to '02'. :P
try to use this optimization level
-Og Optimize debugging experience. -Og enables optimizations that do not interfere with debugging. It should be the optimization level of choice for the standard edit-compile-debug cycle, offering a reasonable level of optimization while maintaining fast compilation and a good debugging experience.
am also lately facing a similar problem, but am quite concerned with the execution time of the code, as my codes should work on real time systems. so i have to use my variables as locals and even reuse the local variables. the thing is i want to trace those variables.(the most important signals i use as global anyway) but sometime i want to watch all the signals. during code execution.
1- i tried to make copy section at the end of the code to a global array to copy the local variables but its not the best idea because the text section is huge then and the execution is not the best plus the compiler declare the local variables as static.
2- i tried to insert 5 NOPS after each local variable change to mark this area and to write a call instruction and then movsd instruction from local variable to xmm7 at run time, to watch that local variable. but the problem is that i can watch only 1 variable at a time and a huge problem to add label for each variable (i have at least 3 to 5 thousand signal)
if anyone can help me with any other idea????