Bug 13511 - 'info variable' and 'info functions' very slow and memory cosuming
Summary: 'info variable' and 'info functions' very slow and memory cosuming
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: symtab (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-16 17:11 UTC by Andre'
Modified: 2023-03-06 23:50 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andre' 2011-12-16 17:11:21 UTC
When starting a "system" libreoffice from ubuntu 11.04, and attaching gdb, 'info variables' takes more then a minute to start producing output. 

When doing the same with a debug build of the a Qt based application (I am use Qt Creator itself as test case), gdb starts eating all available memory at a rate of several gigabytes per minute.
Comment 1 dje 2012-01-11 20:25:51 UTC
gdb does full symtab expansion here which will use a lot of debug info.

One thought is to have enough information to be able to avoid that.
E.g., could .gdb_index include enough info to avoid having to do full symtab expansion? [that also has problems, but "info var|fun|type" is common enough that triggering an explosion of debug info reading is annoying and worth avoiding]
[and similarly for psymtabs, as well as maybe enhancing pubnames/pubtypes]

Another thought is to be more selective with debug info reading.
Is it possible to read only the parts of the CU (dwarf-speak) that we need?

Another thought is to throw out the info as we're finished using it, perhaps guided by various parameters.
[we'll have to read it again, but that's preferable to bringing a machine to a crawl]
Comment 2 Tom Tromey 2023-03-06 23:50:59 UTC
Maybe this would be more bearable with lazy expansion, see bug #29398