public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "l.lunak at suse dot cz" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/13498] New: save-index makes gdb slow with dwarf4
Date: Wed, 14 Dec 2011 17:21:00 -0000	[thread overview]
Message-ID: <bug-13498-4717@http.sourceware.org/bugzilla/> (raw)

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.


             reply	other threads:[~2011-12-14 17:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14 17:21 l.lunak at suse dot cz [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-13498-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).