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. How to make the release version of a visual studio 2008 c++ project so i can step in and debug?

How to make the release version of a visual studio 2008 c++ project so i can step in and debug?

Scheduled Pinned Locked Moved C / C++ / MFC
announcementcsharpc++visual-studiodebugging
10 Posts 5 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.
  • N Offline
    N Offline
    ns
    wrote on last edited by
    #1

    there was a way to do it in vc 6...i forget how... the trouble i am having is the debug works fine but the release crashes. so i want to step into the release version.... it could be done in vc6...how to do it in vs2008? thanks!

    A L 2 Replies Last reply
    0
    • N ns

      there was a way to do it in vc 6...i forget how... the trouble i am having is the debug works fine but the release crashes. so i want to step into the release version.... it could be done in vc6...how to do it in vs2008? thanks!

      A Offline
      A Offline
      Aescleal
      wrote on last edited by
      #2

      You can debug a release version but the code tends to have been moved around a bit by the compiler. Make sure you're building with debug information (right click on project->settings, C++->general, debug information format set to program database) and then copy the PDB file to the directory you're running your code from. If it doesn't remove the bug try disabling optimisation as well - it makes debugging easier. Cheers, Ash

      N 1 Reply Last reply
      0
      • A Aescleal

        You can debug a release version but the code tends to have been moved around a bit by the compiler. Make sure you're building with debug information (right click on project->settings, C++->general, debug information format set to program database) and then copy the PDB file to the directory you're running your code from. If it doesn't remove the bug try disabling optimisation as well - it makes debugging easier. Cheers, Ash

        N Offline
        N Offline
        ns
        wrote on last edited by
        #3

        thank you Ash! I did what you said... Make sure you're building with debug information (right click on project->settings, C++->general, debug information format set to program database) then I set a breakpoint in the release version of the code (in the IDE) and ran it expecting it to stop at the breakpoint. But it did not and the breakpoint did not look colored anymore. It just ran on and crashed. I would like the code to stop executing at the breakpoint so I can step in and proceed line by line. thanks!

        E 1 Reply Last reply
        0
        • N ns

          there was a way to do it in vc 6...i forget how... the trouble i am having is the debug works fine but the release crashes. so i want to step into the release version.... it could be done in vc6...how to do it in vs2008? thanks!

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          You may find these interesting: Surviving the Release Version[^] Debugging Release Mode Problems[^] :)

          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

          Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

          N 1 Reply Last reply
          0
          • N ns

            thank you Ash! I did what you said... Make sure you're building with debug information (right click on project->settings, C++->general, debug information format set to program database) then I set a breakpoint in the release version of the code (in the IDE) and ran it expecting it to stop at the breakpoint. But it did not and the breakpoint did not look colored anymore. It just ran on and crashed. I would like the code to stop executing at the breakpoint so I can step in and proceed line by line. thanks!

            E Offline
            E Offline
            Eugen Podsypalnikov
            wrote on last edited by
            #5

            In addition, that Ash said, please check the following :) : - C++\Optimization: NO - Linker\GenerateDebugInformation: YES

            They sought it with thimbles, they sought it with care; They pursued it with forks and hope; They threatened its life with a railway-share; They charmed it with smiles and soap. :)

            T N 2 Replies Last reply
            0
            • E Eugen Podsypalnikov

              In addition, that Ash said, please check the following :) : - C++\Optimization: NO - Linker\GenerateDebugInformation: YES

              They sought it with thimbles, they sought it with care; They pursued it with forks and hope; They threatened its life with a railway-share; They charmed it with smiles and soap. :)

              T Offline
              T Offline
              Tim Craig
              wrote on last edited by
              #6

              Eugen Podsypalnikov wrote:

              - C++\Optimization: NO

              Generally, you go to the trouble of debugging a release version because the debug version is working and you want to see why optimizations are screwing up the release version. If you turn off optimizations, you have the debug version.

              Once you agree to clans, tribes, governments...you've opted for socialism. The rest is just details.

              E 1 Reply Last reply
              0
              • T Tim Craig

                Eugen Podsypalnikov wrote:

                - C++\Optimization: NO

                Generally, you go to the trouble of debugging a release version because the debug version is working and you want to see why optimizations are screwing up the release version. If you turn off optimizations, you have the debug version.

                Once you agree to clans, tribes, governments...you've opted for socialism. The rest is just details.

                E Offline
                E Offline
                Eugen Podsypalnikov
                wrote on last edited by
                #7

                Wow... :) Thank you !

                They sought it with thimbles, they sought it with care; They pursued it with forks and hope; They threatened its life with a railway-share; They charmed it with smiles and soap. :)

                1 Reply Last reply
                0
                • E Eugen Podsypalnikov

                  In addition, that Ash said, please check the following :) : - C++\Optimization: NO - Linker\GenerateDebugInformation: YES

                  They sought it with thimbles, they sought it with care; They pursued it with forks and hope; They threatened its life with a railway-share; They charmed it with smiles and soap. :)

                  N Offline
                  N Offline
                  ns
                  wrote on last edited by
                  #8

                  Thank you!! Thank you!! Thank you!!! I can step in now!:)

                  1 Reply Last reply
                  0
                  • L Luc Pattyn

                    You may find these interesting: Surviving the Release Version[^] Debugging Release Mode Problems[^] :)

                    Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                    Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                    N Offline
                    N Offline
                    ns
                    wrote on last edited by
                    #9

                    Very informative! Reading them now. Many thanks :)

                    L 1 Reply Last reply
                    0
                    • N ns

                      Very informative! Reading them now. Many thanks :)

                      L Offline
                      L Offline
                      Luc Pattyn
                      wrote on last edited by
                      #10

                      you're welcome. :)

                      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                      Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                      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