Search code examples
visual-studio-2010visual-studio-debugging

Debugging in release mode or changing _iterator_debug_level?


I am working with a checked-out Visual Studio C++ Project originally built in VS 2006. I want to put in breakpoints to see where certain functions are called and better follow the workflow.

I rebuilt the code in Visual Studio 2010 in Release mode, and it builds and runs well. Unfortunately, from some research, I have learned that some of the breakpoints cannot be hit in Release mode and I need to build the code in Debug mode to hit the breakpoints.

However, when I try to build the code in Debug mode, the linker complains about the .lib files having the wrong _ITERATOR_DEBUG_LEVEL. Is there a way that I can change this _ITERATOR_DEBUG_LEVEL in the .libs so I can build it in debug mode? If not, is there any way to hit these breakpoints in Release mode or ReleaseWithDebug mode?


Solution

  • I just saw this article from Hansleman recently:

    http://www.hanselman.com/blog/DebugVsReleaseTheBestOfBothWorlds.aspx

    It basically says you can compile for optimizations (Release) and debug without recompile (Debug) using a combination of debug settings and an ini file.