From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Antonio Cavallo <a.cavallo@cavallinux.eu>
Cc: gdb@sourceware.org
Subject: Re: gdb symbol lookup very slow
Date: Thu, 29 May 2014 20:40:00 -0000 [thread overview]
Message-ID: <20140529192212.GA12686@host2.jankratochvil.net> (raw)
In-Reply-To: <53859746.7030601@cavallinux.eu>
On Wed, 28 May 2014 09:59:02 +0200, Antonio Cavallo wrote:
> Hi,
> I'm having hard time debugging a (very large) C++ library under gdb (gdb
> 7.7.1, gcc 4.8, binutils 2.22).
>
> The main issue is the time it takes to reach a breakpoint: gdb takes an
> insane amount of time (order of 2mins) vs vs2012 (a couple of seconds).
>
> I've profiled gdb and the top functions called during the debugging are
> (more than 90% is spent in these):
Try to use gdb-add-index (gdb/contrib/gdb-add-index.sh or
/usr/bin/gdb-add-index on some systems) with gdb-7.7+.
That the index is present in a binary you can verify with:
$ readelf -WS /usr/lib/debug/bin/bash.debug|grep -w gdb_index
[34] .gdb_index PROGBITS 0000000000000000 21bc44 0252fa 00 0 0 1
Or with recent enough readelf even with:
readelf --debug-dump=gdb_index /usr/lib/debug/bin/bash.debug
or with elfutils:
eu-readelf --debug-dump=gdb_index /usr/lib/debug/bin/bash.debug
You should check you use .gdb_index version 8, older versions had various
issues and they can get ignored by recent GDBs.
There is also an unrelated GDB performance Bug which happens with binaries
optimized by 'dwz' but I do not think that is your described case.
Bug 16405 - backtrace takes GBs and minutes with dwz -m
https://sourceware.org/bugzilla/show_bug.cgi?id=16405
Jan
prev parent reply other threads:[~2014-05-29 19:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-28 8:56 Antonio Cavallo
2014-05-28 22:43 ` Andrew Burgess
2014-05-29 2:48 ` Antonio Cavallo
2014-05-29 20:40 ` Jan Kratochvil [this message]
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=20140529192212.GA12686@host2.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=a.cavallo@cavallinux.eu \
--cc=gdb@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