Qt Creator debugger, very slow
-
The version of Qt Creator is out of my control it is what I'm issued with on this contract:
Qt Creator 4.2.1 Based on Qt 5.8.0 (MSVC 2015, 32 bit) Built on Jan 20 2017 01:29:39 From revision 7071b61e02 Enterprise Features: Enabled
I'm finding that when the debugger stops at a break point it takes an extremely long time for the animation to stop and the watch windows to update with the current parameters.
I'm trying to debug a CPP application which has QML and calls from the QML to CPP functions. Is there anything I can do to improve the performance?
The development system isn't particularly special either:
OS Name: Microsoft Windows 10 Enterprise Version: 10.0.16299 Build 16299 System Model: Latitude 5480 System Type: x64-based PC Processor: Intel(R) Core(TM) i5-7300U CPU @ 2.60GHz, 2701 Mhz, 2 Core(s), 4 Logical Processor(s) Installed Physical Memory (RAM): 8GB Total Physical Memory: 7.86 GB Available Physical Memory: 2.76 GB Total Virtual Memory: 9.18 GB Available Virtual Memory: 2.83 GB Page File Space: 1.31 GB
The hardware and operating system used are out of my control, however what I'm asking is are there any optimizations or settings that could help improve the performance?
-
The version of Qt Creator is out of my control it is what I'm issued with on this contract:
Why? Creator is just a tool. The MSVC debugger improved a lot in the last versions, so upgrading might make sense.
Or try to compile with MinGW and use the GDB debugger. On Windows most often the better choice.
Regards
-
@SPlatten said in Qt Creator debugger, very slow:
I'm finding that when the debugger stops at a break point it takes an extremely long time for the animation to stop and the watch windows to update with the current parameters.
The microsoft console debugger (assuming this is what you're using) is the culprit. It's really slow, especially with big datasets. I've experienced a similar thing stepping into large codebases a couple of years back. Unfortunately, there's little you can do. If you can switch to mingw/gdb, as @aha_1980 suggested, you may see an improvement (I had).
-
I had this same issue over a two year on both, Windows and Linux systems.
After lots of digging my solution is:Linux :
1 Locate default.qws file and delete it (or make backup)/home/user/.config/QtProject/qtcreator/default.qws
2 Select option:
Tools > Options > Debugger > GDB > Use automatic symbol cache.
3 Restart QtCreator (it will create new one default.qws file)
Windows:
1 Locate **QtProject ** folder and make backup of this folder (rename to QtProjectBackup)C:\Users\user\AppData\Roaming\QtProject\
2 Select option:
Tools > Options > Debugger > GDB > Use automatic symbol cache.
3 Restart QtCreator (it will create new one QtProject folder)
4. Configure QtCreator again. -
@sandmeteor
I tried your steps on Windows with Qt 6.4.3 MSVC 2019 and debugging speed is increased. Thanks you. -
Maybe off of this topic, but still relevant for people debugging a Qt application.
I have had this exact problem for over a year now working on WSL2 but not with QtCreator, just developing in VS Code with C++ and QML.
@SPlatten said in Qt Creator debugger, very slow:
I'm finding that when the debugger stops at a break point it takes an extremely long time for the animation to stop and the watch windows to update with the current parameters.
The solution for me was to add the following on my home directory as it is explained in this video from KDAB (thank you so much Jesper Pedersen).
echo "set index-cache on" >> ~/.gdbinit
This made a huge difference in speeding up my debugging.
I hope this helps.
-
Note that the option Use automatic symbol cache in Qt Creator will end up issue the
set index-cache on
command to GDB.As seen at https://codereview.qt-project.org/c/qt-creator/qt-creator/+/348577 from Jun 11, 2021.