public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/13498] New: save-index makes gdb slow with dwarf4
@ 2011-12-14 17:21 l.lunak at suse dot cz
  2011-12-14 23:28 ` [Bug gdb/13498] " l.lunak at suse dot cz
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: l.lunak at suse dot cz @ 2011-12-14 17:21 UTC (permalink / raw)
  To: gdb-prs

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.


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-12-31 16:42 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-14 17:21 [Bug gdb/13498] New: save-index makes gdb slow with dwarf4 l.lunak at suse dot cz
2011-12-14 23:28 ` [Bug gdb/13498] " l.lunak at suse dot cz
2011-12-15 15:55 ` l.lunak at suse dot cz
2012-02-15 12:12 ` lionel at mamane dot lu
2012-02-16 11:00 ` mjw at redhat dot com
2012-02-17 21:48 ` tromey at redhat dot com
2012-02-17 21:52 ` tromey at redhat dot com
2012-02-20 13:51 ` l.lunak at suse dot cz
2012-02-20 19:51 ` tromey at redhat dot com
2012-02-20 19:55 ` tromey at redhat dot com
2012-02-20 20:57 ` cvs-commit at gcc dot gnu.org
2012-02-21  6:32 ` dje at google dot com
2012-02-21 18:17 ` l.lunak at suse dot cz
2012-07-08 19:35 ` dje at google dot com
2012-07-10 20:29 ` cvs-commit at gcc dot gnu.org
2023-12-31 13:08 ` ssbssa at sourceware dot org
2023-12-31 16:42 ` tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).