Riz
Riz

Reputation: 6676

visual studio debug vs release mode

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

Answers (4)

user3731622
user3731622

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

Mitchel Sellers
Mitchel Sellers

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

Serkan Hekimoglu
Serkan Hekimoglu

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

Darin Dimitrov
Darin Dimitrov

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

Related Questions