GDB debug very slow with big variables [message #1767833] |
Tue, 11 July 2017 13:07 |
John Cooper Messages: 5 Registered: July 2017 |
Junior Member |
|
|
Hi everyone,
I have the issue that debugging with GDB in eclipse CDT gets extremely slow when large lists/variables/vectors are involved. When I hover over a large variable or have the "Variables" view open it takes sometimes 5-10 minutes to show the values.
In that time I can not continue stepping through the program.
When the variables are shown finally and I step forward I have to wait again more than 5 minutes until it shows the updated variables. I tried everything I found on the internet to speed up, but nothing worked.
Please see my eclipse GDB config below.
I'm running ubuntu 14.04 with Eclipse Oxygen and GDB 7.7.1.
I activated the GDB traces view and it gets stuck at
805,391 (gdb)
805,398 103-stack-list-locals --thread 1 --frame 0 1
805,400 104-stack-list-frames --thread 1
before finally showing the content of the huge variables and then:
219,344 (gdb)
219,345 104^done,stack=[frame={level="0",addr="0x00000000004072b0",func="sfm_reconstruct",file="sfmr\
econ.cc",fullname="/home/john/development/mve/apps/sfmrecon/sfmrecon.cc",line="233"},frame={level\
="1",addr="0x0000000000409d3a",func="main",file="sfmrecon.cc",fullname="/home/john/development/mv\
e/apps/sfmrecon/sfmrecon.cc",line="635"}]
219,345 (gdb)
When debugging with GDB in the terminal and print "p bigVariable" it shows immediately only a small fraction without any delay. Then I can show more or quit showing the variable. I think that must also be possible with Eclipse, otherwise I can't debug big programs with Eclipse.
Do you have any idea how can I configure Eclipse/GDB to show only a fraction of the variables??? The config below doesn't seem to work though. I am quite desperate at the moment.
Thank you very much,
John
|
|
|
|
|
|
|
|
Re: GDB debug very slow with big variables [message #1767998 is a reply to message #1767954] |
Wed, 12 July 2017 15:36 |
John Cooper Messages: 5 Registered: July 2017 |
Junior Member |
|
|
Hi Jonah,
I filed a bug report:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=519561
Disabling C/C++ -> Editor -> Hovers -> Combined Hover resolved the hover issue for me.
So the current workaround for me that works:
Closing "Variables" view, having "Expressions" view open with "Expressions Only View" enabled and disabling any hovering enables me to debug big vectors while being quite speedy.
Having the "Variables" view open issues the GDB commands "stack-list-locals" and "stack-list-frames" which results in minutes of waiting per debugging step.
To solve this the GDB commands/arguments need to be modified or other commands issued instead which don't return a listing of all the contents of the variables (which are not shown in the first place to the user anyway).
I am not a GDB expert unfortunately, so I can't come up with commands or arguments to have a quick fix on this.
[Updated on: Wed, 12 July 2017 15:41] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02736 seconds