Qt creator not giving me information about variables while debugging
-
wrote on 8 Oct 2022, 09:21 last edited by
Hey, I am running into some problems with debugging with Qt creator recently (using QtCreator 8.0.1). When hitting a breakpoint in a function, and stepping through it, the local stack variables disappear from the view (top right window in the video) and I cant inspect them anymore afterwards, also some statements are skipped while stepping through my code:
https://streamable.com/7ae63kDoes anyone have an idea on how I could be able to fix this?
Thanks in advance -
wrote on 10 Oct 2022, 15:44 last edited by
-
wrote on 10 Oct 2022, 15:59 last edited by
Thanks for the reply, I am using gdb 12.1 on linux (KDE Manjaro).
What information specifically should I be looking for? The output is quiet much
-
wrote on 10 Oct 2022, 16:00 last edited by
You don't seem to have debug info for Qt available, so not being able to step into the QFile constructor is expected.
On a general note, be careful on what you have in your "Evaluated Expressions". This is executed(!) in the context of the current frame on each step, so destructive function calls or for performance reasons invalid code should be avoided.
-
wrote on 10 Oct 2022, 16:37 last edited by
Why wouldn't I have debug symbols, if I am running it in debug mode, and my compile options are:
target_compile_options(adapters PRIVATE "$<$<CONFIG:DEBUG>:-Wall;-Wextra;-g3;-Og>") target_compile_options(adapters PRIVATE "$<$<CONFIG:RELEASE>:-O3>")
Also, this still doesn't explain why I cant see my stack variables and why I cant query their values
-
Why wouldn't I have debug symbols, if I am running it in debug mode, and my compile options are:
target_compile_options(adapters PRIVATE "$<$<CONFIG:DEBUG>:-Wall;-Wextra;-g3;-Og>") target_compile_options(adapters PRIVATE "$<$<CONFIG:RELEASE>:-O3>")
Also, this still doesn't explain why I cant see my stack variables and why I cant query their values
wrote on 10 Oct 2022, 16:41 last edited by@Creaperdown
The options are only for compiling your own code. Unless you have compiled Qt itself for debug or got its symbols from somewhere, and the source code is present, you are not going to see source inside a Qt function. That should be a separate issue from your own code. -
wrote on 10 Oct 2022, 16:47 last edited by
-
wrote on 10 Oct 2022, 17:28 last edited by
I see, this probably is the problem here. Since I want to use Qt 5.15.5, but the Qt Installer doesnt offer my a way to download it, I am using my desktops automatically provided Qt, which probably doesnt have the debug information
-
Hi,
Qt 5.15.3 and onward when released are only in source format so you have to build them yourself.
As for your distribution provided Qt, there are usually separated packages with debug informations.
-
Hi,
Qt 5.15.3 and onward when released are only in source format so you have to build them yourself.
As for your distribution provided Qt, there are usually separated packages with debug informations.
wrote on 10 Oct 2022, 22:07 last edited by@SGaist How exactly would I add these packages to work with QtCreator?
-
wrote on 11 Oct 2022, 10:40 last edited by
It looks like you are using Manjaro Linux. As it turns out Manjaro doesn't build packages with Debug symbols,
that is if I interpret https://forum.manjaro.org/t/debug-symbols-on-manjaro/61157 correctly.You will have to install Qt via https://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run and select the Qt Debug Information Files at installation time.
-
It looks like you are using Manjaro Linux. As it turns out Manjaro doesn't build packages with Debug symbols,
that is if I interpret https://forum.manjaro.org/t/debug-symbols-on-manjaro/61157 correctly.You will have to install Qt via https://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run and select the Qt Debug Information Files at installation time.
wrote on 11 Oct 2022, 15:37 last edited by@cristian-adam said in Qt creator not giving me information about variables while debugging:
It looks like you are using Manjaro Linux. As it turns out Manjaro doesn't build packages with Debug symbols,
that is if I interpret https://forum.manjaro.org/t/debug-symbols-on-manjaro/61157 correctly.Actually if we have a look at https://wiki.archlinux.org/title/Debugging/Getting_traces there is advice how to install debug packages:
# pacman -U https://geo.mirror.pkgbuild.com/extra-debug/os/x86_64/qt6-base-debug-6.4.0-1-x86_64.pkg.tar.zst
10/12