Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Setting up Qt Source Code debugging



  • Hi.
    In an attempt to debug my Could not create shader problem, I tried to setup Qt Creator for Qt Source Code debugging, with the idea of setting
    a breakpoint at the warning line to find out which thread/part of the program is causing the problem.

    I configured Qt Creator's Debugger settings for Qt Source debugging as follows:

    vmplayer_2020-06-02_17-36-01.png

    I installed GDB Multiarch and setup the Kit to use it:

    vmplayer_2020-06-02_17-38-08.png

    Then, I put a breakpoint in the file source file concerned:
    Qt/5.15.0/Src/qtbase/src/gui/opengl/qopenglshaderprogram.cpp at the line that generates the warning.

    This does not work though. The breakpoint is not hit before the message gets printed.

    I tried the same approach once on Windows to debug an Android problem a couple of Qt Versions ago, and that seemed to work.

    What am I missing here? I am using the latest Qt Creator and targetting Qt 5.15.0 on Raspbian Buster/Pi3B+.



  • Since I cross-built Qt for Pi on my own machine, the Source path and Target path are the same really:

    vmplayer_2020-06-03_16-23-57.png

    So actually, no Source Path Mapping is actually needed at all, and the above mapping can be removed.

    I can jump into Qt Source Code correctly during the remote debug session now.


  • Qt Champions 2019

    @Diracsbracket You have:

    • /home/qt
    • /home/umagi

    Why do you have "qt" user? Does your user account have read access there?



  • @jsulm said in Setting up Qt Source Code debugging:

    /home/qt

    Hi...
    You're right, the Source Path as shown above is for debugging Qt apps intended for the host platform, not the target platform, which means I must rebuild a debug version of Qt for the Pi.

    However, I just tried the -debug-and-release option of the configure script (starting from a clean slate), but strangely, the configure summary still indicates Mode .....release?

    Configure summary:
    
    Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
    Building for: devices/linux-rasp-pi3-g++ (arm, CPU features: neon)
    Target compiler: gcc 8.3.0
    Configuration: cross_compile enable_new_dtags largefile neon shared shared rpath release c++11 c++14 c++17 c++1z concurrent dbus reduce_exports stl
    Build options:
      Mode ................................... release
    

  • Qt Champions 2019

    @Diracsbracket Did you rerun configure from a clean state?



  • @jsulm
    Yes, I did delete the shadow build dir completely before rerunning configure.



  • Ahh.... At the bottom of the configure summary is this:

    ERROR: Feature 'debug_and_release' was enabled, but the pre-condition 'config.darwin || config.win32' failed.
    

    So the debug-and-release does not seem to be supported for linux? I will use -debug then.



  • Since I cross-built Qt for Pi on my own machine, the Source path and Target path are the same really:

    vmplayer_2020-06-03_16-23-57.png

    So actually, no Source Path Mapping is actually needed at all, and the above mapping can be removed.

    I can jump into Qt Source Code correctly during the remote debug session now.


Log in to reply