What is the difference b/w Debug and Release
-
-
Hello Everybody... I had some confusion. 1.What are the basic diffence in building a program in Debug and Release in VC++ 6.0. 2.Is there any affect to the logic of the code in this two versions. thanx in advance birajendu CyberG India Delhi India
-
Hello Everybody... I had some confusion. 1.What are the basic diffence in building a program in Debug and Release in VC++ 6.0. 2.Is there any affect to the logic of the code in this two versions. thanx in advance birajendu CyberG India Delhi India
the simpler you can do to see a difference is simply looking at the generated .exe files sizes. in debug mode compilation, the file is more "heavy" because the compiler don't perform some optimizations, and the more important, it does insert some functions into the generated code to perform the debugging thing... if you are able to use a breakpoint, a step by step debugging, etc, is thanks to these. in release mode, the compiler tries to make the exe the more performant as possible... when you make a delivery version of a project, provide the release mode compiled version.
TOXCCT >>> GEII power
[toxcct][VisualCalc 2.20][VisualCalc 3.0] -
Hello Everybody... I had some confusion. 1.What are the basic diffence in building a program in Debug and Release in VC++ 6.0. 2.Is there any affect to the logic of the code in this two versions. thanx in advance birajendu CyberG India Delhi India
Very basic answer: In Debug you can set breakpoints and step through the code to see how each line is executed. The code size is bigger (all symbols are loaded for debugging) and it is also slower. All code in
ASSERT()
, macros (which is usually checking if everything oes OK) is executed, letting you point out where exactely a program crashes. In Release, compiler optimisations are turned on, and the code is smaller and usually much quicker. If the program crashes, all you get is a messagebox notification, and it is more difficult, if not impossible, to find out what instruction crashed. As the names suggest, debug compilation is for debugging purposes, and the release compilation is used for building software released to your users/customers/rest of the world. ~RaGE(); -
Very basic answer: In Debug you can set breakpoints and step through the code to see how each line is executed. The code size is bigger (all symbols are loaded for debugging) and it is also slower. All code in
ASSERT()
, macros (which is usually checking if everything oes OK) is executed, letting you point out where exactely a program crashes. In Release, compiler optimisations are turned on, and the code is smaller and usually much quicker. If the program crashes, all you get is a messagebox notification, and it is more difficult, if not impossible, to find out what instruction crashed. As the names suggest, debug compilation is for debugging purposes, and the release compilation is used for building software released to your users/customers/rest of the world. ~RaGE(); -
Hello Everybody... I had some confusion. 1.What are the basic diffence in building a program in Debug and Release in VC++ 6.0. 2.Is there any affect to the logic of the code in this two versions. thanx in advance birajendu CyberG India Delhi India
One important point which is mentioned in various articles on code project (eg. Survive the Release Build - see first reply) but has not appeared in the replies to you is that the debug build tends to initialise local variable storage to 0 when a function is called, while with Relese builds, you gvet whatever the contents were. As long as your warning level checks for "variables used before being assigned values", this should not be a problem.
-
One important point which is mentioned in various articles on code project (eg. Survive the Release Build - see first reply) but has not appeared in the replies to you is that the debug build tends to initialise local variable storage to 0 when a function is called, while with Relese builds, you gvet whatever the contents were. As long as your warning level checks for "variables used before being assigned values", this should not be a problem.
thanx Norman, ya i was confused only due to the local variable issue,which behaved differently in debug and release versions.I had gone thru the code project article also. Now I feel somewhat comfortable in understanding these problems.. Thanx a lot... birajendu CyberG India Delhi India
-
One important point which is mentioned in various articles on code project (eg. Survive the Release Build - see first reply) but has not appeared in the replies to you is that the debug build tends to initialise local variable storage to 0 when a function is called, while with Relese builds, you gvet whatever the contents were. As long as your warning level checks for "variables used before being assigned values", this should not be a problem.
... initialise local variable storage to 0 Not that I have noticed. In fact, Visual C++ 6.0 and .NET 2002 both set unassigned variables to something like 0xCDCDCDCD. Also in Debug mofe, apart from the preprocessor variable _DEBUG being defined, changes are made to several system functions, including new and delete to help catch problems with memory allocation. Allocated blocks of memory have guard bands around them. All user-written functions have code added at the beginning and end to look for problems. If you release a Debug build, beware - there is debugging information in the .EXE file, a wonderful opportunity for hackers. Makes life so much easier for people to disassemble your program. Try writing a program that WILL crash, and compile it both in Debug mode and in Releae mode. Run the Release version outside the Visual C++ environment, as if it was an ordinary program being run. When it crashes, the system will offer to help debug it. Accept the defaults offered, and you will find yourself back in Visual C++, wondering what on earth you are looking at. Do the same with the Debug build and you will see the difference. Note that the checks for unassigned variables are not foolproof, unfortunately. I have sometimes have the Debug version work perfectly, and the Release version of the same code crashes due to unasigned variables not being detected. Shraddhan