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. DEBUG AND RELEASE MODE

DEBUG AND RELEASE MODE

Scheduled Pinned Locked Moved C / C++ / MFC
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.
  • K Offline
    K Offline
    karmendra_js
    wrote on last edited by
    #1

    hello, I want to know what is the difference between debug mode and release mode. I started adn finished my project in release mode, how would it be different if it was done in debug mode. Thanks,

    K T D G 4 Replies Last reply
    0
    • K karmendra_js

      hello, I want to know what is the difference between debug mode and release mode. I started adn finished my project in release mode, how would it be different if it was done in debug mode. Thanks,

      K Offline
      K Offline
      kakan
      wrote on last edited by
      #2

      Hello. The differences I came to think about (there might be other deifferences as well) is: In the debug version, there is (of course) a lot of information that aids the debugger. There are no code optimisations in the debug build. Allocated memory is filled with nulls in debug mode. More, anyone?

      C 1 Reply Last reply
      0
      • K karmendra_js

        hello, I want to know what is the difference between debug mode and release mode. I started adn finished my project in release mode, how would it be different if it was done in debug mode. Thanks,

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

        kakan is right, but to complete, just compare the sizes of your two generated (debug and release) exes... you'll see the difference !


        TOXCCT >>> GEII power
        [toxcct][VisualCalc]

        1 Reply Last reply
        0
        • K karmendra_js

          hello, I want to know what is the difference between debug mode and release mode. I started adn finished my project in release mode, how would it be different if it was done in debug mode. Thanks,

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          In Debug mode, all local variables not explicitly initialized by the program are initialized with 0xCC.

          karmendra_js wrote:

          I started adn finished my project in release mode, how would it be different if it was done in debug mode.

          This is backwards. You should develop and test it in Debug mode, and only when all of the bugs have been removed should you compile it in Release mode.


          "Take only what you need and leave the land as you found it." - Native American Proverb

          1 Reply Last reply
          0
          • K kakan

            Hello. The differences I came to think about (there might be other deifferences as well) is: In the debug version, there is (of course) a lot of information that aids the debugger. There are no code optimisations in the debug build. Allocated memory is filled with nulls in debug mode. More, anyone?

            C Offline
            C Offline
            Chintoo723
            wrote on last edited by
            #5

            kakan wrote:

            Allocated memory is filled with nulls in debug mode

            whats the reason for this difference? thanks!

            G K 2 Replies Last reply
            0
            • C Chintoo723

              kakan wrote:

              Allocated memory is filled with nulls in debug mode

              whats the reason for this difference? thanks!

              G Offline
              G Offline
              Gary R Wheeler
              wrote on last edited by
              #6

              In debug mode, filling uninitialized memory with zero's makes it easier to see that your program has not initialized it.


              Software Zen: delete this;

              1 Reply Last reply
              0
              • K karmendra_js

                hello, I want to know what is the difference between debug mode and release mode. I started adn finished my project in release mode, how would it be different if it was done in debug mode. Thanks,

                G Offline
                G Offline
                Gary R Wheeler
                wrote on last edited by
                #7

                In debug mode, two things happen. First, the compiler generates information about your program used by the debugger. The compiler also generates code to initialize memory to default values. Second, in debug mode you run your programmer under the debugger. The debugger lets you step through your code, examine data as the program executes, set breakpoints, and perform other operations. The purpose of the debugger is to let you run your program in a controlled fashion so that you can see what it is doing as it runs. In release mode, the compiler doesn't initialize memory for you; it assumes your program will initialize what it needs. As a rule, in release mode the compiler will also 'optimize' your code. In simplest terms, the compiler generates machine code that runs as fast as possible. The machine code in this case looks different from the debug version, since the compiler can rearrange operations in order to improve efficiency. As someone else has mentioned, you really want to run your program in debug mode first. This lets you get things working in a controlled environment. After it looks like things are working correctly in debug mode, rebuild the program in release mode, and test it again. There are subtle differences between debug and release. The article Debugging Release Mode Problems[^] has more information.


                Software Zen: delete this;

                1 Reply Last reply
                0
                • C Chintoo723

                  kakan wrote:

                  Allocated memory is filled with nulls in debug mode

                  whats the reason for this difference? thanks!

                  K Offline
                  K Offline
                  kakan
                  wrote on last edited by
                  #8

                  See Gary R. Wheeler's answer, above. But this difference in behaviour is a very common source of problems in release mode builds.

                  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