Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Setting up Qt Source Code debugging

    Mobile and Embedded
    2
    7
    947
    Loading More Posts
    • 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.
    • Diracsbracket
      Diracsbracket last edited by Diracsbracket

      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+.

      jsulm 1 Reply Last reply Reply Quote 0
      • Diracsbracket
        Diracsbracket @Diracsbracket last edited by Diracsbracket

        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.

        1 Reply Last reply Reply Quote 1
        • jsulm
          jsulm Lifetime Qt Champion @Diracsbracket last edited by

          @Diracsbracket You have:

          • /home/qt
          • /home/umagi

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

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

          Diracsbracket 1 Reply Last reply Reply Quote 0
          • Diracsbracket
            Diracsbracket @jsulm last edited by Diracsbracket

            @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
            
            jsulm 1 Reply Last reply Reply Quote 0
            • jsulm
              jsulm Lifetime Qt Champion @Diracsbracket last edited by

              @Diracsbracket Did you rerun configure from a clean state?

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

              Diracsbracket 1 Reply Last reply Reply Quote 0
              • Diracsbracket
                Diracsbracket @jsulm last edited by

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

                Diracsbracket 1 Reply Last reply Reply Quote 0
                • Diracsbracket
                  Diracsbracket @Diracsbracket last edited by Diracsbracket

                  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.

                  Diracsbracket 1 Reply Last reply Reply Quote 0
                  • Diracsbracket
                    Diracsbracket @Diracsbracket last edited by Diracsbracket

                    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.

                    1 Reply Last reply Reply Quote 1
                    • First post
                      Last post