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
Forum Updated to NodeBB v4.3 + New Features

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.
  • DiracsbracketD Offline
    DiracsbracketD Offline
    Diracsbracket
    wrote on last edited by Diracsbracket
    #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+.

    jsulmJ 1 Reply Last reply
    0
    • DiracsbracketD 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.

      DiracsbracketD Offline
      DiracsbracketD Offline
      Diracsbracket
      wrote on last edited by Diracsbracket
      #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
      • DiracsbracketD 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+.

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on 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

        DiracsbracketD 1 Reply Last reply
        0
        • jsulmJ jsulm

          @Diracsbracket You have:

          • /home/qt
          • /home/umagi

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

          DiracsbracketD Offline
          DiracsbracketD Offline
          Diracsbracket
          wrote on last edited by Diracsbracket
          #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
          
          jsulmJ 1 Reply Last reply
          0
          • DiracsbracketD 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
            
            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @Diracsbracket Did you rerun configure from a clean state?

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

            DiracsbracketD 1 Reply Last reply
            0
            • jsulmJ jsulm

              @Diracsbracket Did you rerun configure from a clean state?

              DiracsbracketD Offline
              DiracsbracketD Offline
              Diracsbracket
              wrote on last edited by
              #5

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

              DiracsbracketD 1 Reply Last reply
              0
              • DiracsbracketD Diracsbracket

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

                DiracsbracketD Offline
                DiracsbracketD Offline
                Diracsbracket
                wrote on last edited by Diracsbracket
                #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.

                DiracsbracketD 1 Reply Last reply
                0
                • DiracsbracketD 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.

                  DiracsbracketD Offline
                  DiracsbracketD Offline
                  Diracsbracket
                  wrote on last edited by Diracsbracket
                  #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

                  • Login

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