How should you disable all types of optimizations while debugging in VS2010?
To insure optimizations are off, right click on your project -> Properties -> Configuration Properties -> C/C++ -> Optimization -> Optimization = Disabled. This is the /Od compiler switch.