Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to step into qt source code when debug

how to step into qt source code when debug

Scheduled Pinned Locked Moved Solved General and Desktop
14 Posts 4 Posters 11.7k Views
  • 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.
  • betterorbestB Offline
    betterorbestB Offline
    betterorbest
    wrote on last edited by
    #1

    I have tried a few days, but can't do this.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      You might have to build a debug version of the Qt you are using.
      with configure option -debug-and-release.
      If using visual studio, in some versions of Qt the PDB files are included.
      So it depends on what you have installed
      http://qihome.org/qiliang/2013/01/30/how-to-debug-into-qt-library-in-qt-creator-with-cdb/

      betterorbestB 1 Reply Last reply
      3
      • mrjjM mrjj

        Hi
        You might have to build a debug version of the Qt you are using.
        with configure option -debug-and-release.
        If using visual studio, in some versions of Qt the PDB files are included.
        So it depends on what you have installed
        http://qihome.org/qiliang/2013/01/30/how-to-debug-into-qt-library-in-qt-creator-with-cdb/

        betterorbestB Offline
        betterorbestB Offline
        betterorbest
        wrote on last edited by
        #3

        @mrjj
        I have added src files and debug symbols shown in the following picture.
        firstly, the src dir mapping:
        0_1498379471710_dff65ae3-0615-4dee-a5f8-675820edc644-image.png
        secondly, the debug symbol setting:
        0_1498379643250_5b315ffc-f081-43b6-a36b-b34c2475b822-image.png .
        However, I still couldn't step into the source code.

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          Maybe I'm taking a detour here, why are you looking to debug inside Qt?
          Are you looking to contribute to Qt itself?

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          A betterorbestB 2 Replies Last reply
          0
          • VRoninV VRonin

            Maybe I'm taking a detour here, why are you looking to debug inside Qt?
            Are you looking to contribute to Qt itself?

            A Offline
            A Offline
            Asperamanca
            wrote on last edited by
            #5

            @VRonin said in how to step into qt source code when debug:

            Maybe I'm taking a detour here, why are you looking to debug inside Qt?
            Are you looking to contribute to Qt itself?

            Stepping into Qt code can be enlightening in many cases where you don't quite understand why things behave as they do. I can highly recommend it.

            betterorbestB 1 Reply Last reply
            4
            • VRoninV VRonin

              Maybe I'm taking a detour here, why are you looking to debug inside Qt?
              Are you looking to contribute to Qt itself?

              betterorbestB Offline
              betterorbestB Offline
              betterorbest
              wrote on last edited by
              #6

              @VRonin
              I wanted to know something as Asperamanca said.

              1 Reply Last reply
              0
              • A Asperamanca

                @VRonin said in how to step into qt source code when debug:

                Maybe I'm taking a detour here, why are you looking to debug inside Qt?
                Are you looking to contribute to Qt itself?

                Stepping into Qt code can be enlightening in many cases where you don't quite understand why things behave as they do. I can highly recommend it.

                betterorbestB Offline
                betterorbestB Offline
                betterorbest
                wrote on last edited by
                #7

                @Asperamanca
                So do you have any suggestion to step into the qt source code? Thank you.

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  Asperamanca
                  wrote on last edited by
                  #8

                  When I had trouble stepping into Qt source, usually the application used the "release" dlls of Qt (e.g. Qt5Core.dll instead of Qt5Cored.dll). See if your debugger shows you which dlls are loaded on startup.

                  If this is the problem, the easiest way to fix it is to put only the debug dlls in the application's start path.

                  betterorbestB 1 Reply Last reply
                  0
                  • A Asperamanca

                    When I had trouble stepping into Qt source, usually the application used the "release" dlls of Qt (e.g. Qt5Core.dll instead of Qt5Cored.dll). See if your debugger shows you which dlls are loaded on startup.

                    If this is the problem, the easiest way to fix it is to put only the debug dlls in the application's start path.

                    betterorbestB Offline
                    betterorbestB Offline
                    betterorbest
                    wrote on last edited by
                    #9

                    @Asperamanca
                    Sorry that this is not my problem.
                    Also I want to say, if you are in debug mode, it will not use Qt5Core.dll. The Qt Creator has already set the correct .dll files with *d.dll in debug and *.dll in release.

                    A 1 Reply Last reply
                    0
                    • betterorbestB betterorbest

                      @Asperamanca
                      Sorry that this is not my problem.
                      Also I want to say, if you are in debug mode, it will not use Qt5Core.dll. The Qt Creator has already set the correct .dll files with *d.dll in debug and *.dll in release.

                      A Offline
                      A Offline
                      Asperamanca
                      wrote on last edited by
                      #10

                      @betterorbest said in how to step into qt source code when debug:

                      @Asperamanca
                      Sorry that this is not my problem.
                      Also I want to say, if you are in debug mode, it will not use Qt5Core.dll. The Qt Creator has already set the correct .dll files with *d.dll in debug and *.dll in release.

                      What is your problem then? Can you describe

                      • What you intend to do
                      • How you do it
                      • What you expect to happen
                      • What actually happens
                      betterorbestB 1 Reply Last reply
                      0
                      • A Asperamanca

                        @betterorbest said in how to step into qt source code when debug:

                        @Asperamanca
                        Sorry that this is not my problem.
                        Also I want to say, if you are in debug mode, it will not use Qt5Core.dll. The Qt Creator has already set the correct .dll files with *d.dll in debug and *.dll in release.

                        What is your problem then? Can you describe

                        • What you intend to do
                        • How you do it
                        • What you expect to happen
                        • What actually happens
                        betterorbestB Offline
                        betterorbestB Offline
                        betterorbest
                        wrote on last edited by
                        #11

                        @Asperamanca
                        I intend to step into the Qt source code;
                        I have installed Qt5.5.0 with Src selected. As what people online say, with the Src directory setted, I can step into Qt src code. But this didn't happened. For example, I can't step into the func show() of qwidgets.
                        In Qtcreator, I have done what the following link says, http://qihome.org/qiliang/2013/01/30/how-to-debug-into-qt-library-in-qt-creator-with-cdb/.

                        A 1 Reply Last reply
                        0
                        • betterorbestB betterorbest

                          @Asperamanca
                          I intend to step into the Qt source code;
                          I have installed Qt5.5.0 with Src selected. As what people online say, with the Src directory setted, I can step into Qt src code. But this didn't happened. For example, I can't step into the func show() of qwidgets.
                          In Qtcreator, I have done what the following link says, http://qihome.org/qiliang/2013/01/30/how-to-debug-into-qt-library-in-qt-creator-with-cdb/.

                          A Offline
                          A Offline
                          Asperamanca
                          wrote on last edited by
                          #12

                          @betterorbest
                          I mostly debug with Visual Studio, but I just tried it with Qt Creator and Qt 5.9 MinGW. In my case, I could step into Qt sources but the lines numbers were all wrong (the program was clearly executing other code than what I saw as the 'current line').
                          Sorry if I can't help you - but with Creator, I simply lack the experience.

                          betterorbestB 1 Reply Last reply
                          0
                          • A Asperamanca

                            @betterorbest
                            I mostly debug with Visual Studio, but I just tried it with Qt Creator and Qt 5.9 MinGW. In my case, I could step into Qt sources but the lines numbers were all wrong (the program was clearly executing other code than what I saw as the 'current line').
                            Sorry if I can't help you - but with Creator, I simply lack the experience.

                            betterorbestB Offline
                            betterorbestB Offline
                            betterorbest
                            wrote on last edited by
                            #13

                            @Asperamanca
                            Really thank you for your answer.
                            I also debugged with visual stuido 2013 and qt add-in. I have set the src directory in Solution setting. Also I downloaded pdb-msvc-2013-32.7z and set the debug symbol in visual studio. However it didn't work.

                            1 Reply Last reply
                            0
                            • betterorbestB Offline
                              betterorbestB Offline
                              betterorbest
                              wrote on last edited by
                              #14

                              I have solved the problem after I downloaded Qt5.8.0 and installed it. Maybe the problem is just in Qt5.5.0 because of the incorrect pdb files downloaded from Qt official website.

                              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