When optimization is enabled, the code being debugged is different than the code debugged without optimization. For example, some instructions might be more efficient for the processor when optimization is turned on but they may introduce timing issues.
TIP: Disable compiler optimizations during the development and debugging phases.
The example below shows the
[BuildOptions] section that may be added to the DSC example from Chapter 30 to disable compiler optimizations for all compilers.
[BuildOptions]GCC:*_*_*_CC_FLAGS = -O0INTEL:*_*_*_CC_FLAGS = /OdMSFT:*_*_*_CC_FLAGS = /Od