Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Generating debug symbols (pdb) for release
Forum Updated to NodeBB v4.3 + New Features

Generating debug symbols (pdb) for release

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
10 Posts 4 Posters 11.3k 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.
  • J Offline
    J Offline
    jay_s
    wrote on last edited by
    #1

    Hello,

    I'm trying to generate the pdb files on a release configuration of Qt 5.6.2. The compiler is Visual Studio 2008 on Windows 32b.

    First I executed jom after running this configure command:
    configure -opensource -platform win32-msvc2008 -debug-and-release -force-debug-info -opengl desktop -nomake examples -nomake tests

    But only the pdbs for the debug DLLs where generated (the *d.dll).

    So I tried removing the -force-debug-info, and adding to qtbase\mkspecs\win32-msvc2008\qmake.conf and qtbase\mkspecs\common\msvc-desktop.conf the following flags:
    MAKE_CFLAGS_RELEASE = -O2 -MD -Zi
    QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO /DEBUG

    More specifically, I overwrote those flags on msvc-desktop.conf, and also appended them to msvc2008\qmake.conf. Either way, only the pdbs for the debug DLLs were generated, as if these flags are being ignored.

    Could you give me some pointers?

    Thank you!

    raven-worxR 1 Reply Last reply
    0
    • J jay_s

      Hello,

      I'm trying to generate the pdb files on a release configuration of Qt 5.6.2. The compiler is Visual Studio 2008 on Windows 32b.

      First I executed jom after running this configure command:
      configure -opensource -platform win32-msvc2008 -debug-and-release -force-debug-info -opengl desktop -nomake examples -nomake tests

      But only the pdbs for the debug DLLs where generated (the *d.dll).

      So I tried removing the -force-debug-info, and adding to qtbase\mkspecs\win32-msvc2008\qmake.conf and qtbase\mkspecs\common\msvc-desktop.conf the following flags:
      MAKE_CFLAGS_RELEASE = -O2 -MD -Zi
      QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO /DEBUG

      More specifically, I overwrote those flags on msvc-desktop.conf, and also appended them to msvc2008\qmake.conf. Either way, only the pdbs for the debug DLLs were generated, as if these flags are being ignored.

      Could you give me some pointers?

      Thank you!

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @jay_s
      For C++ (MSVC) you need to set the following in your .pro file (no need to alter any qmake config files):

      QMAKE_CXXFLAGS += /Zi
      QMAKE_LFLAGS += /DEBUG 
      

      depending if you want fully optimized Release build (read this) you can also add:

      QMAKE_LFLAGS += /OPT:REF /OPT:ICF
      

      Additionally you can use more specific QMAKE variables like QMAKE_CXXFLAGS_RELEASE and also scope them only to msvc compiler and release mode:

      msvc:release {
          ...
      }
      

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      3
      • J Offline
        J Offline
        jay_s
        wrote on last edited by
        #3

        Thanks for the quick reply!

        I appended the following block to the qt.pro in Qt5's root directory and re-executed the configure script just in case, but still only the *d.dll pdbs are being generated in qtbase/lib.

        msvc:release {
        QMAKE_CXXFLAGS_RELEASE += /Zi
        QMAKE_LFLAGS_RELEASE += /DEBUG
        }

        JonBJ raven-worxR 2 Replies Last reply
        0
        • J jay_s

          Thanks for the quick reply!

          I appended the following block to the qt.pro in Qt5's root directory and re-executed the configure script just in case, but still only the *d.dll pdbs are being generated in qtbase/lib.

          msvc:release {
          QMAKE_CXXFLAGS_RELEASE += /Zi
          QMAKE_LFLAGS_RELEASE += /DEBUG
          }

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @jay_s
          You did force a complete rebuild for sure after changing the flags in the .pro file, didn't you?

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jay_s
            wrote on last edited by jay_s
            #5

            @JonB Yes, I started with newly unzipped Qt5.6.2 sources.

            I'm also using "jom -j 4 clean" before rebuilds.

            I've tried also appending only the flags without the guard to qt.pro, but the pdbs for the release DLLs are still not being generated.

            QMAKE_CXXFLAGS_RELEASE += /Zi
            QMAKE_LFLAGS_RELEASE += /DEBUG

            1 Reply Last reply
            0
            • J jay_s

              Thanks for the quick reply!

              I appended the following block to the qt.pro in Qt5's root directory and re-executed the configure script just in case, but still only the *d.dll pdbs are being generated in qtbase/lib.

              msvc:release {
              QMAKE_CXXFLAGS_RELEASE += /Zi
              QMAKE_LFLAGS_RELEASE += /DEBUG
              }

              raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              @jay_s said in Generating debug symbols (pdb) for release:

              I appended the following block to the qt.pro in Qt5's root directory and re-executed the configure script just in case, but still only the *d.dll pdbs are being generated in qtbase/lib.
              msvc:release {
              QMAKE_CXXFLAGS_RELEASE += /Zi
              QMAKE_LFLAGS_RELEASE += /DEBUG
              }

              what about this:

              msvc:CONFIG(debug, debug|release) {
                QMAKE_CXXFLAGS_RELEASE += /Zi
                QMAKE_LFLAGS_RELEASE += /DEBUG
              }
              

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0
              • J Offline
                J Offline
                jay_s
                wrote on last edited by jay_s
                #7

                @raven-worx said in Generating debug symbols (pdb) for release:

                what about this:
                msvc:CONFIG(debug, debug|release) {
                QMAKE_CXXFLAGS_RELEASE += /Zi
                QMAKE_LFLAGS_RELEASE += /DEBUG
                }

                I tried placing that block by the end of qt.pro, but still the release pdbs are not being created, after performing a clean command and rebuilding. I wonder what's missing...

                D 1 Reply Last reply
                0
                • J jay_s

                  @raven-worx said in Generating debug symbols (pdb) for release:

                  what about this:
                  msvc:CONFIG(debug, debug|release) {
                  QMAKE_CXXFLAGS_RELEASE += /Zi
                  QMAKE_LFLAGS_RELEASE += /DEBUG
                  }

                  I tried placing that block by the end of qt.pro, but still the release pdbs are not being created, after performing a clean command and rebuilding. I wonder what's missing...

                  D Offline
                  D Offline
                  Devopia53
                  wrote on last edited by
                  #8

                  @jay_s

                  Have you tried adding -separate-debug-info with -force-debug-info to the configure option?

                  1 Reply Last reply
                  1
                  • J Offline
                    J Offline
                    jay_s
                    wrote on last edited by jay_s
                    #9

                    @Devopia53

                    Hm same situation:

                    The -separate-debug-info option results in this error on Win64, MSVC2008:
                    ERROR: -separate-debug-info was requested but this binutils does not support it.

                    So I did a 'jom clean' and reconfigure without that option, but now including the -force-debug-info:

                    configure -opensource -platform win32-msvc2008 -debug-and-release -force-debug-info -opengl desktop -nomake examples -nomake tests
                    

                    But once again, only the debug DLL pdbs are generated in qtbase/lib:
                    Qt5Concurrentd.pdb
                    Qt5Cored.pdb
                    Qt5DBusd.pdb
                    Qt5Guid.pdb
                    Qt5Networkd.pdb
                    Qt5OpenGLd.pdb
                    Qt5PrintSupportd.pdb
                    Qt5Sqld.pdb
                    Qt5Testd.pdb
                    Qt5Widgetsd.pdb
                    Qt5Xmld.pdb

                    raven-worxR 1 Reply Last reply
                    0
                    • J jay_s

                      @Devopia53

                      Hm same situation:

                      The -separate-debug-info option results in this error on Win64, MSVC2008:
                      ERROR: -separate-debug-info was requested but this binutils does not support it.

                      So I did a 'jom clean' and reconfigure without that option, but now including the -force-debug-info:

                      configure -opensource -platform win32-msvc2008 -debug-and-release -force-debug-info -opengl desktop -nomake examples -nomake tests
                      

                      But once again, only the debug DLL pdbs are generated in qtbase/lib:
                      Qt5Concurrentd.pdb
                      Qt5Cored.pdb
                      Qt5DBusd.pdb
                      Qt5Guid.pdb
                      Qt5Networkd.pdb
                      Qt5OpenGLd.pdb
                      Qt5PrintSupportd.pdb
                      Qt5Sqld.pdb
                      Qt5Testd.pdb
                      Qt5Widgetsd.pdb
                      Qt5Xmld.pdb

                      raven-worxR Offline
                      raven-worxR Offline
                      raven-worx
                      Moderators
                      wrote on last edited by raven-worx
                      #10

                      @jay_s said in Generating debug symbols (pdb) for release:

                      So I did a 'jom clean' and reconfigure without that option

                      just a hint: if you the configuration changes you should execute the dist-clean make target.

                      But once again, only the debug DLL pdbs are generated in qtbase/lib

                      Why do you need pdb files for the executables?

                      Beside that you can also specifiy MSVC linker options via an environment variable (similar for the compiler).

                      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                      If you have a question please use the forum so others can benefit from the solution in the future

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved