Reputation: 6676
Hi I'm using Visual studio 2010 and I can't figure out one thing. I can debug and set breakpoints in release mode as well as debug mode. so then what's the difference between the two?
Upvotes: 6
Views: 12901
Reputation: 5095
Here is a link to a Microsoft page titled How to: Set Debug and Release Configurations
It discusses the difference between Debug and Release. At the top of the page you can select different versions of Visual Studio.
Upvotes: 0
Reputation: 63126
here is a more detailed answer on Scott Hanselmans Blog
But the root of the issue is that the code is compiled with more optimizations, you can still debug due to the creation of the pdb files.
Upvotes: 5
Reputation: 4284
Newly allocated memory contains arbitrary values - whatever happened to be last sitting there. In release builds this is untouched. Debug builds in VS initialise newly allocated memory to 0xcdcdcdcd to flag is as "uninitialised".
Why would a release build fill memory with junk to make debugging easier? Release modes are just that - minimal extra overhead for actual releases.
Upvotes: 3
Reputation: 1038710
The difference is optimizations that the compiler applies in Release mode. You can place breakpoints if you have PDB files and by default they are generated even in Release mode.
Upvotes: 8