6

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?

1

4 Answers 4

8

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.

1
  • So you can build projects and test them with Release mode in Visual Studio with no fear to skip a breakpoint or don't get debug info?
    – Rumplin
    Sep 27, 2011 at 11:01
5

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.

3

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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.