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:I installed GDB Multiarch and setup the Kit to use it:
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
andTarget path
are the same really: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.
-
@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, theSource 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 theconfigure
script (starting from a clean slate), but strangely, the configure summary still indicatesMode .....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
-
@Diracsbracket Did you rerun configure from a clean state?
-
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
andTarget path
are the same really: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.