AN4989 Rev 3
33/118
AN4989
Compiling for debug
117
3
Compiling for debug
This chapter reviews the various options for debug-friendly compiling solutions.
3.1 Optimization
Compiler are usually configured by default to optimize performance and/or code size. In
most cases, this reduces or even prevents program debugging.
The most common symptoms resulting from code optimization are:
•
Problem to set or reach a breakpoint. Some lines are not accessible.
•
Impossibility to evaluate a variable (watch feature).
•
Inconsistency while stepping (what I get, is not what I see).
Therefore, for efficient debugging it is recommended to modify the code optimization option.