What is difference in debugging in debug mode and release mode? In release mode the symbols table that is loaded contains less information of symbols which means less debugging information. But, if we set "Disabled (/Od)" in C/C++->Optimization->Optimization then I could not see any difference in two debugging type. Is there any difference in debug mode and release mode(with Optimization Disabled)?
1 Answer
There's very little magic to it. Debug and Release are simply names assigned to a set of compiler options. The most relevant option for the Debug configuration is the /Od option, it disables the optimizer so your code is easier to debug.
Clearly you can always change the Release configuration options to resemble the Debug configuration options. Like disabling the optimizer. Now there's no relevant difference anymore between them and the Release configuration behaves a lot like the Debug configuration in the debugger.
Other options normally used in the Debug configuration that affects your code:
- the _DEBUG macro is defined, asserts will fire
- function inlining is turned off
- the /RTC option is turned on, very good at catching bugs in your code
- the _HAS_ITERATOR_DEBUGGING macro is defined, catching bugs in code that uses STL classes
- you'll link with the debug build of the CRT, enabling asserts in that build
- the debug allocator will be enabled, assuming you #included crtdbg.h
- edit + continue support is turned on, a side effect is much bigger stack frames