This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/13498] New: save-index makes gdb slow with dwarf4
- From: "l.lunak at suse dot cz" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Wed, 14 Dec 2011 17:21:01 +0000
- Subject: [Bug gdb/13498] New: save-index makes gdb slow with dwarf4
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=13498
Bug #: 13498
Summary: save-index makes gdb slow with dwarf4
Product: gdb
Version: HEAD
Status: NEW
Severity: minor
Priority: P2
Component: gdb
AssignedTo: unassigned@sourceware.org
ReportedBy: l.lunak@suse.cz
Classification: Unclassified
When using the gdb-add-index script in order to modify binaries for faster load
in gdb, some operations such as tab completion of function names are noticeably
slower if the binaries have been built with -gdwarf-4. I experience the problem
on openSUSE 11.4 with a git LibreOffice build, using
gdb-weekly-7.3.50.20111213.tar.bz2 snapshot built from source.
Steps to reproduce:
1) Build LibreOffice with -gdwarf-4
(http://wiki.documentfoundation.org/Development/Native_Build , --enable-debug
passed to autogen/configure, current git uses -gdwarf-4 by default if
supported, otherwise can be passed manually by invoking make as
'CFLAGS="-gdwarf-4" CXXFLAGS="-gdwarf-4" make')
2) Run LibreOffice, open an empty Writer document, type in something and save
as a .docx document.
3) Attach gdb, type 'break DocxA<tab>', watch the time it took to complete the
name to DocxAttributeOutput. Try repeatedly (second time it's faster).
4) Modify LibreOffice binaries using the gdb-add-index script (for dev-install
build they are in solver/*/lib/, for normal install they are in
basis3.4/program/).
5) Repeat steps 2) and 3), watch the increased time needed to complete the
function name (second completion takes at most 1 second without the saved index
and more than 5 seconds with it, and this is a fast machine).
The problem presumably exists in other scenarios and other codebases, assuming
they are large enough to make the slowness noticeable.
Further information:
- using dwarf4 instead of dwarf2 saves about 30% size of LibreOffice's binaries
when built with debug info
- the problem does not seem to exist when building with -gdwarf-2
- the debug flag passed to gcc/g++ is -ggdb2 (besides the -gdwarf-2/4)
- the .gdb_index sections in the binaries appear to be loaded both with dwarf2
and dwarf4 by gdb, the load time is faster and memory usage is lower
- when examining /proc/<pid>/status of gdb, in the case of .gdb_index and
dwarf4, VmHWM and VmData are almost the same, while in the dwarf2 case the
VmHWM is about 20% larger than VmData (perhaps in the dwarf2 case gdb generates
additional internal data that is not generated in the dwarf4 case and that
causes this?)
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.