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 debug into Qt core sources (and show sources)
Forum Updated to NodeBB v4.3 + New Features

How to step debug into Qt core sources (and show sources)

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.8k 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.
  • E Offline
    E Offline
    elpaso
    wrote on last edited by
    #1

    Hi,

    I googled about this topic but I couldn't find a working solution for me, I'm probably doing something wrong.
    I build Qt 5.9.3 from sources with:

    PREFIX=~/local
    
    ./configure \
        -prefix $PREFIX \
        -debug \
        -opensource \
        -confirm-license \
        -ccache \
        -platform linux-clang
    
    make -j9 install
    

    Then I've configured Qt creator kit to use qmake in /home/myuser/local/bin/qmake but I'm not able to switch header/source into Qt core neither to step-debug into the implementation, I can see the headers though, and the header location is the expected one (under ~/local/include).
    Original source were built from /home/myuser/Qt/5.9.3/Src (same location of the build script I've pasted above).
    I'm on linux Xenial and Qt Creator 4.5.0
    Anything I could try?

    jsulmJ 1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @elpaso said in How to step debug into Qt core sources (and show sources):

      Anything I could try?

      Perhaps do an in-source build instead of specifying a separate prefix? Then potentially Qt Creator will be able to see the sources.

      I mean something like:

      cd 5.9.3/Src
      ./configure -prefix $PWD
      

      Or -prefix $PWD/qtbase, I'm not sure which will work. Well, I'm not sure if either will work, I've never tried to get all sources in Qt Creator.

      (Z(:^

      E 1 Reply Last reply
      0
      • E elpaso

        Hi,

        I googled about this topic but I couldn't find a working solution for me, I'm probably doing something wrong.
        I build Qt 5.9.3 from sources with:

        PREFIX=~/local
        
        ./configure \
            -prefix $PREFIX \
            -debug \
            -opensource \
            -confirm-license \
            -ccache \
            -platform linux-clang
        
        make -j9 install
        

        Then I've configured Qt creator kit to use qmake in /home/myuser/local/bin/qmake but I'm not able to switch header/source into Qt core neither to step-debug into the implementation, I can see the headers though, and the header location is the expected one (under ~/local/include).
        Original source were built from /home/myuser/Qt/5.9.3/Src (same location of the build script I've pasted above).
        I'm on linux Xenial and Qt Creator 4.5.0
        Anything I could try?

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @elpaso You can add the Qt sources in QtCreator settings in Debugger tab.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        E 1 Reply Last reply
        3
        • jsulmJ jsulm

          @elpaso You can add the Qt sources in QtCreator settings in Debugger tab.

          E Offline
          E Offline
          elpaso
          wrote on last edited by elpaso
          #4

          @jsulm thanks for the tip, I've tried that without success, but maybe I didn't get it right, this is what I set when click on "Add Qt sources ...":

          /Source path: /var/tmp/qt-src
          Target path: /home/myuser/Qt/5.9.3/Src
          

          I tried to get the path as seen by the debugger by enabling tooltips but I don't get any useful information.

          I've also tried to set the source path to PREFIXPATH without success:

          /Source path: /home/myuser/local
          Target path: /home/myuser/Qt/5.9.3/Src
          
          1 Reply Last reply
          0
          • sierdzioS sierdzio

            @elpaso said in How to step debug into Qt core sources (and show sources):

            Anything I could try?

            Perhaps do an in-source build instead of specifying a separate prefix? Then potentially Qt Creator will be able to see the sources.

            I mean something like:

            cd 5.9.3/Src
            ./configure -prefix $PWD
            

            Or -prefix $PWD/qtbase, I'm not sure which will work. Well, I'm not sure if either will work, I've never tried to get all sources in Qt Creator.

            E Offline
            E Offline
            elpaso
            wrote on last edited by
            #5

            @sierdzio thanks for the suggestion, I did not try that, but after a clean rebuild I'm now able to step-debug into core libraries, but still cannot switch header/source or click on a function and jump to the implementation.

            A small step forward though :)

            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