How to Debug the Release Build?

16 11 2008

“Debugging in release build!!! Is it possible?” I’ve heard this questions a couple of time, especially from Visual C++ Novices. Yes! its possible. But why?
I still remember my first project. We did everything right, debugged and fixed all bugs in debug build and released the application. But client tested the release version and it was like FatMan, a lot of crashes.

So, Debugging in release build is important because, even though the debug build can catch most of issues, there might be some bugs or crashes still hiding under the release version of application. For catching them, there is now way other than to debug the release build itself.


Well, basically compiler needs debug information for stepping into code while debugging and In release build, by default there will not be any debug information. Compilers cannot interpret or understand optimized code and in release build, optimization will be enabled by default. For debugging in release build, you’ve to generate debug information and to turn off optimizations. Follow the steps about how to tweak project settings for that.

1) Take project settings by Alt+F7.
2) Select Release configuration.
3) Select “C/C++” tab. Set “Optimizations” as “Disable Debug” and “Debug Info” as “Program Database”.


4) Take “Link” tab. Enable “Generate Debug Info“.


5) Now from menu, take – “Build > Set active configuration…” and select Release build as default.


6) Rebuild the project by F7.
7) Now what are you waiting for? Press F5 to debug and enjoy!

Since my first project, I don’t forget how to debug in release version. 😀 and this is my advice for you – “Its fine to do the entire debugging in debug build, because its tuned to catch a lot of bugs. But before releasing check the release build too.”

Targeted Audience – Beginners.