[Qt-creator] GDB is so slow whendebuggiong QtCreator

Jochen Becher jochen_becher at gmx.de
Sat Jun 22 20:01:36 CEST 2024


I am using QtCreator 13.0.2, the official build for Linux running on
Ubuntu 22.04. I installed it with the Q Maintenance tool.

It is not a new observation, I have seen this issue in the past for
many years. But it doesn't happen every time I debug into QtCreator or
other software.

First, the start of QtCreator in Debug mode with one Breakpoint set (in
QbsProjectManager) needs about 2 minutes. I already reduced the number
of plugins to load. It is a little annoying to wait that long but this
is not the biggest issue.

Second, for testing I disabled almost all special features including
"Show QObject names if available" and others. I build QtCreator using
qbs (not cmake) but I would be surprised if the issue is related to
that.

>From the GDB log it looks like the issue is related to the variable
dump in python:

====================== snip ===================

19:56:26.387
>&"python
theDumper.fetchVariables({\"autoderef\":0,\"context\":\"\",\"displaystr
inglimit\":300,\"dyntype\":0,\"expanded\":{\"inspect\":50,\"local\":50,
\"return\":50,\"watch\":50},\"fancy\":0,\"formats\":{},\"nativemixed\":
0,\"partialvar\":\"\",\"passexceptions\":0,\"qobjectnames\":0,\"resultv
arname\":\"\",\"stringcutoff\":300,\"timestamps\":1,\"token\":28,\"type
formats\":{},\"watchers\":[]})\n"
t19:56:26.387
d[GDB] Output handled

>~"result={token=\"28\",data=[{iname=\"local.this\",name=\"this\",origa
ddr=\"0x7fffffffaf30\",address=\"0x7fff8ce1e120\",autoderefcount=\"1\",
address=\"0x7fff8ce1e120\",numchild=\"1\",type=\"QbsProjectManager::Int
ernal::DefaultPropertyProvider\",value=\"\",time=\"2.059138298034668\",
},{iname=\"local.k\",name=\"k\",origaddr=\"0x7fffffffaf28\",address=\"0
x55555622c2c0\",numchild=\"1\",type=\"ProjectExplorer::Kit*\",value=\"0
x55555622c2c0\",time=\"8.032690525054932\",},{iname=\"local.defaultData
\",name=\"defaultData\",address=\"0x7fffffffb4b0\",numchild=\"1\",type=
\"QVariantMap
&\",value=\"\",time=\"0.0006394386291503906\",},{iname=\"local.data\",n
ame=\"data\",address=\"0x7fffffffb3a8\",numchild=\"1\",type=\"QVariantM
ap\",value=\"\",time=\"2.6941299438476562e-
05\",},{iname=\"local.sysroot\",name=\"sysroot\",address=\"0x7fffffffb0
00\",numchild=\"1\",type=\"QString\",value=\"\",time=\"1.76429748535156
25e-
05\",},{iname=\"local.tcC\",name=\"tcC\",origaddr=\"0x7fffffffaf60\",ad
dress=\"0x5555570dca90\",numchild=\"1\",type=\"ProjectExplorer::Toolcha
in*\",value=\"0x5555570dca90\",time=\"4.374573230743408\",},{iname=\"lo
cal.tcCxx\",name=\"tcCxx\",origaddr=\"0x7fffffffaf68\",address=\"0x7fff
f6f81fb2\",numchild=\"1\",type=\"ProjectExplorer::Toolchain*\",value=\"
0x7ffff6f81fb2 <QApplicationPrivate::notify_helper(QObject*,
QEvent*)+130>\",time=\"4.377530336380005\",},{iname=\"local.mainTc\",na
me=\"mainTc\",origaddr=\"0x7fffffffaf70\",address=\"0x5555570dca90\",nu
mchild=\"1\",type=\"ProjectExplorer::Toolchain*\",value=\"0x5555570dca9
0\",time=\"4.336947202682495\",},{iname=\"local.targetAbi\",name=\"targ
etAbi\",address=\"0x7fffffffb270\",numchild=\"1\",type=\"ProjectExplore
r::Abi\",value=\"\",time=\"4.839897155761719e-
05\",},{iname=\"local.archs\",name=\"archs\",address=\"0x7fffffffb020\"
,numchild=\"1\",type=\"QList<QString>\",value=\"\",time=\"1.90734863281
25e-
05\",},{iname=\"local.toolchain\",name=\"toolchain\",address=\"0x7fffff
ffb040\",numchild=\"1\",type=\"QStringList\",value=\"\",time=\"3.075599
670410156e-05\",},],typeinfo=[],partial=\"0\",counts={},timings=[]}\n"
t19:56:58.189 [31802ms]
d[GDB] Output handled
t19:56:58.189
>28^done
t19:56:58.189
t[GDB] Response time: python
theDumper.fetchVariables({"autoderef":0,"context":"","displaystringlimi
t":300,"dyntype":0,"expanded":{"inspect":50,"local":50,"return":50,"wat
ch":50},"fancy":0,"formats":{},"nativemixed":0,"partialvar":"","passexc
eptions":0,"qobjectnames":0,"resultvarname":"","stringcutoff":300,"time
stamps":1,"token":28,"typeformats":{},"watchers":[]}): 31.87 s
t19:56:58.199 [1ms]
 <Rebuild Watchmodel 1 @ 19:56:58.198 [9ms] >
t19:56:58.199
 [GDB] Finished retrieving data.
t19:56:58.200 [1ms]
d[GDB] Output handled
t19:56:58.200

====================== snip ===================

This is the typical output from every single step.

Regards, Jochen


Am Samstag, dem 22.06.2024 um 08:08 +0200 schrieb apoenitz:
> On Fri, Jun 21, 2024 at 09:51:32PM +0200, Jochen Becher via Qt-
> creator wrote:
> > Hi,
> > 
> > GDB in QtCreator is not always slow but when I used it to debug
> > QtCreator itself (currently in QbsProjectManager) it is so slow on
> > updating the local variables - at least that is spinning about 1
> > minute
> > on each step.
> > 
> > I am not aware of any settings that I did to make it slow. Is there
> > anything I can verify? Or is it just a GDB issue?
> 
> The "Show QObject names if available" option in the "Debugger->Locals
> & Expressions" settings is on by default and can be quite heavy in
> some
> setups, and more on the "nice to have, but not desperately needed"
> side.
> 
> It's mentioned in the tooltip, but I agree this is not obvious, and
> I am not really happy with the gain-for-pain ratio here myself.
> I guess it's time to make that off by default.
> 
> Other options that impact performance are "Debugger->GDB->Use dynamic
> object type", and of course "Locals & Expressionsp->Use debugging
> helper".
> 
> What version are you using? The self-build Creator you are working
> on?
> 
> Andre'



More information about the Qt-creator mailing list