Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. What is the difference b/w Debug and Release

What is the difference b/w Debug and Release

Scheduled Pinned Locked Moved C / C++ / MFC
c++debuggingquestionannouncement
8 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    birajendu
    wrote on last edited by
    #1

    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

    T P R N 4 Replies Last reply
    0
    • B birajendu

      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

      P Offline
      P Offline
      Prakash Nadar
      wrote on last edited by
      #2

      Read this[^]


      -Prakash

      1 Reply Last reply
      0
      • B birajendu

        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

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        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]

        1 Reply Last reply
        0
        • B birajendu

          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

          R Offline
          R Offline
          Rage
          wrote on last edited by
          #4

          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();

          B 1 Reply Last reply
          0
          • R 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();

            B Offline
            B Offline
            birajendu
            wrote on last edited by
            #5

            thanx....to all of you birajendu CyberG India Delhi India

            1 Reply Last reply
            0
            • B birajendu

              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

              N Offline
              N Offline
              normanS
              wrote on last edited by
              #6

              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.

              B S 2 Replies Last reply
              0
              • N normanS

                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.

                B Offline
                B Offline
                birajendu
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0
                • N normanS

                  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.

                  S Offline
                  S Offline
                  Shraddhan
                  wrote on last edited by
                  #8

                  ... 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

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups