From: Doug Evans <dje@google.com>
To: gdb-patches@sourceware.org
Cc: saugustine@google.com
Subject: [COMMITTED PATCH] Fix PR symtab/17591
Date: Fri, 14 Nov 2014 00:58:00 -0000 [thread overview]
Message-ID: <yjt2a93u61j8.fsf@ruffy.mtv.corp.google.com> (raw)
Hi.
This patch fixes pr 17591.
Regression tested on amd64-linux.
The removing of the parens wasn't taking into account
looking up "(anonymous namespace)".
It turns out there can be a significant performance cost.
The lookup would use "" which in the program where this
was found had an entry in .gdb_index with ~1000 CUs,
none of which had (anonymous namespace),
so we were needlessly reading in a *lot* of debug info.
Before:
(gdb) pt obj
type = ...
Command execution time: 50.712058 (cpu), 52.275078 (wall)
Space used: 2379862016 (+2180878336 for this command)
#symtabs: 150433 (+150064), #primary symtabs: 2090 (+2081), #blocks: 774710 (+773450)
After:
(gdb) pt obj
type = ...
Command execution time: 0.850209 (cpu), 0.864219 (wall)
Space used: 232112128 (+33136640 for this command)
#symtabs: 3040 (+2671), #primary symtabs: 107 (+98), #blocks: 22595 (+21335)
2014-11-13 Doug Evans <dje@google.com>
PR symtab/17591
* dwarf2read.c (find_slot_in_mapped_hash): Handle
"(anonymous namespace)".
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index ce37adf..0c97447 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -2917,7 +2917,11 @@ find_slot_in_mapped_hash (struct mapped_index *index, const char *name,
{
/* NAME is already canonical. Drop any qualifiers as .gdb_index does
not contain any. */
- const char *paren = strchr (name, '(');
+ const char *paren = NULL;
+
+ /* Need to handle "(anonymous namespace)". */
+ if (*name != '(')
+ paren = strchr (name, '(');
if (paren)
{
next reply other threads:[~2014-11-14 0:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-14 0:58 Doug Evans [this message]
2014-11-14 1:10 ` Doug Evans
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=yjt2a93u61j8.fsf@ruffy.mtv.corp.google.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=saugustine@google.com \
/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