How should you disable all types of optimizations while debugging in VS2010?
There should be none or at least less optimization going on in a debug build. Check your buildsettings for more options.
Go to your project, right click on it → Properties → Build → (go down and click on) Advanced → a window will opened and check whether Debug info in Output is Full.
Select the menu item Project->Properties
.
Under Configuration Properties->C/C++->Optimization
, in the Optimization
field, select disabled
.
Add -O0 to compiler parameters. This should turn off all optimizations.
To insure optimizations are off, right click on your project -> Properties -> Configuration Properties -> C/C++ -> Optimization -> Optimization = Disabled. This is the /Od compiler switch.