Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Setting up Qt Source Code debugging

Setting up Qt Source Code debugging

Scheduled Pinned Locked Moved Solved Mobile and Embedded
7 Posts 2 Posters 1.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.
  • D Offline
    D Offline
    Diracsbracket
    wrote on 2 Jun 2020, 08:58 last edited by Diracsbracket 6 Feb 2020, 08:59
    #1

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

    J 1 Reply Last reply 2 Jun 2020, 10:32
    0
    • D Diracsbracket
      2 Jun 2020, 14:37

      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.

      D Offline
      D Offline
      Diracsbracket
      wrote on 3 Jun 2020, 07:28 last edited by Diracsbracket 6 Mar 2020, 08:14
      #7

      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
      1
      • D Diracsbracket
        2 Jun 2020, 08:58

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

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 2 Jun 2020, 10:32 last edited by
        #2

        @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

        D 1 Reply Last reply 2 Jun 2020, 14:25
        0
        • J jsulm
          2 Jun 2020, 10:32

          @Diracsbracket You have:

          • /home/qt
          • /home/umagi

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

          D Offline
          D Offline
          Diracsbracket
          wrote on 2 Jun 2020, 14:25 last edited by Diracsbracket 6 Feb 2020, 14:27
          #3

          @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
          
          J 1 Reply Last reply 2 Jun 2020, 14:27
          0
          • D Diracsbracket
            2 Jun 2020, 14:25

            @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
            
            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 2 Jun 2020, 14:27 last edited by
            #4

            @Diracsbracket Did you rerun configure from a clean state?

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

            D 1 Reply Last reply 2 Jun 2020, 14:28
            0
            • J jsulm
              2 Jun 2020, 14:27

              @Diracsbracket Did you rerun configure from a clean state?

              D Offline
              D Offline
              Diracsbracket
              wrote on 2 Jun 2020, 14:28 last edited by
              #5

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

              D 1 Reply Last reply 2 Jun 2020, 14:37
              0
              • D Diracsbracket
                2 Jun 2020, 14:28

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

                D Offline
                D Offline
                Diracsbracket
                wrote on 2 Jun 2020, 14:37 last edited by Diracsbracket 6 Feb 2020, 14:40
                #6

                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.

                D 1 Reply Last reply 3 Jun 2020, 07:28
                0
                • D Diracsbracket
                  2 Jun 2020, 14:37

                  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.

                  D Offline
                  D Offline
                  Diracsbracket
                  wrote on 3 Jun 2020, 07:28 last edited by Diracsbracket 6 Mar 2020, 08:14
                  #7

                  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
                  1

                  1/7

                  2 Jun 2020, 08:58

                  • Login

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