QtCreator (9.0.1 Debian) debugging helpers don't work. What can be done?
-
I didn't pay attention so no idea when it broke(I didn't need any debugging for a couple of months), but now I don't see a human-readable variant of std::containers while debugging. Now I see something like this: https://imgur.com/a/QHim0PI
I tinkered a bit around, tried a repository version too (keeping an old config and without it). I was in the Edit->Preferences->Debugger. Played with different combinations of parameters. It feels like nothing has changed though...
Now I use the version from the net-installer. How should I enable the "debugging helpers"?
-
Debugging helpers should work normally in Qt Creator 9.0.1.
Edit->Preferences->Debugger.
...that's the right place.
If the helpers' output doesn't make sense and changing the settings doesn't help, I would suspect that the system's kernel blocks
ptrace
. That's what Qt Creator uses to read the debugged processes' memory and populate helpers. Not sure, how to check this on Debian. Here is a link for Ubuntu. -
that the system's kernel blocks ptrace
/proc/sys/kernel/yama/ptrace_scope is 0 and the behavior is the same under root. Looks like the problem is somewhere else...
Does Creator have any logs? I can't find any...
-
Yes it has: See here how to inspect them.
-
Yeah, I saw this window. Nothing interesting regarding my problem there, alas.
It looks like those helpers are some Python scripts. Is it so? Where are they stored? Can they have python-tier compatibility issues? What can I read about them?
I love IDEs while they work as intended, but when something inevitably brokes -- that is hell :)
-
Sorry for that!
Can you please check if the debugging helpers work for Qt and custom classes? Or is it only std::containers that fail?
Can you drop a qDebug() and iterate through the vector<int> experiment just to make sure that the object isn’t dangling? -
I don't use Qt and not sure if I could trivially add something Qt-related to a project.
Custom classes? Well, simple things like
struct Test
{
int a;
int b;
};looks fine, but does it need helpers?
-
On my PC (openSuSE Tumbleweed bleeding edge, Qt Creator 9.0.1), a
std::vector<int>
is correctly displayed in the debugger.The typical reasons for broken helpers are
- dangling pointers / uninitialized memory
- ptrace blocked (obviously not the case on your system)
- debugging source not matching binaries
- incompatible gdb and g++ versions (never had that myself)
- object optimized out (no more usage before going out of scope)
Things you can try to narrow it down:
- use gdb pretty printer instead
- iterate over
std::vector<int> experiment
and dump contents withqDebug()
or just withcout
if it's not a Qt project.
-
iterate over std::vector<int> experimentand dump contents with qDebug() or just with cout
Not sure what you mean. Yes, I can iterate over the container and cout its content as I like; but I really would like more comfortable debugging than printf-tier.
use gdb pretty printer instead
I don't even remember when the last time I used gdb as it is. And a nice gdb interface is like 80% of my reason to use IDE :)
-
This advice is meant to figure out why it's failing for you. That's why I wrote
Things you can try to narrow it down:
If iterating and/or gdb pretty printer have a meaningful output, there's a bug in Qt Creator.
If these options also fail, we have to find the issue on your system. -
If iterating and/or gdb pretty printer have a meaningful output
Iterating-"couting" works as it should.
-
This is a
std::vector<int>
displayed with the debug helpers of Qt Creator 9.0.1.
That said, the issue at hand is a local one I am afraid, having nothing to do with Qt. -
Yes, the problem isn't in the Qt, but in the QtCreator.
gdb works fine and gives rather readable results like
(gdb) p res $1 = std::vector of length 6, capacity 8 = {std::vector of length 1, capacity 1 = {1}, std::vector of length 2, capacity 2 = {1, 1}, std::vector of length 3, capacity 3 = { 1, 2, 1}, std::vector of length 4, capacity 4 = {1, 3, 3, 1}, std::vector of length 5, capacity 5 = {1, 4, 6, 4, 1}, std::vector of length 6, capacity 6 = {1, 5, 10, 10, 5, 1}}
I need some help in understanding how does QtCreator process this data. What are those "debugging helpers". Where are they? What can be wrong with them? And whose responsibility they are.
-
If Qt Creator is correctly installed, it finds and uses these helpers.
How do you build the debug executable? With or without Qt Creator?
Can you post the configure/qmake and compile output? Can you post a screenshot of the compile kit in Qt Creator? -
Yes, I created a tiny project just for dealing with this problem:
cmake_minimum_required(VERSION 3.5) project(experiment LANGUAGES CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) add_executable(experiment main.cpp)
08:11:40: Running steps for project experiment... 08:11:40: Starting: "/usr/bin/cmake" --build /home/astahl/work/experiment/build-experiment-Desktop-Debug --target all [100%] Built target experiment 08:11:40: The process "/usr/bin/cmake" exited normally. 08:11:40: Elapsed time: 00:00.
Kit config screenshot:
-
Well, all looks right.
So you should file a bug here, to have someone from the Qt Creator team take a look at it. -
Well, I was trying to find an alternative to the Creator and was installing/removing different other IDEs. After I failed, I returned to QtCreator to spend another day trying to fix the problem and found that everything was working as it should. No idea what was causing the problem, but now everything is ok.
Maybe some other IDE rewrote some faulty config of some inobvious utility?
No idea.
-
-
Good this is solved.
A few remarks nevertheless:
The debugger's log in Creator is in View->Views...->Debugger log.
/proc/sys/kernel/yama/ptrace_scope is only relevant for attaching to running processes, it should not have played a role here.
There's a Help->Contact entry saying
Qt Creator developers can be reached at the Qt Creator mailing list:
mailto:qt-creator@qt-project.org
or the #qt-creator channel on Libera.Chat IRC:
https://web.libera.chat/#qt-creator
Our bug tracker is located at https://bugreports.qt.io.
Please use https://pastebin.com for bigger chunks of tex -
I just came here from a web search and the issue at hand here is described Qt Creator v9.0.2 Debug Helpers not Working on Ubuntu 23.04 and Debian Bookworm 12
Namely Python3 syntax in Python2 source code used in the debugger helpers, which then fail silently.
The issue has been tracked at https://bugreports.qt.io/browse/QTCREATORBUG-28505 and fixed in Qt Creator 10.