From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20161 invoked by alias); 12 Nov 2014 22:49:53 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 20133 invoked by uid 48); 12 Nov 2014 22:49:52 -0000 From: "dje at google dot com" To: gdb-prs@sourceware.org Subject: [Bug symtab/17591] dwarf2read.c:find_slot_in_mapped_hash needs to handle "(anonymous namespace)" Date: Wed, 12 Nov 2014 22:49:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: 7.8 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dje at google dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dje at google dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q4/txt/msg00243.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17591 --- Comment #1 from dje at google dot com --- Here's a tentative patch. --- /tmp/g4-67641/cache/depot/depot2/gcctools/google_vendor_src_branch/gdb/gdb-7.8.x/gdb/dwarf2read.c#4 2014-08-12 10:45:03.000000000 -0700 +++ /g4/local/ctools/gdb/7.8-gg4/depot2/gcctools/google_vendor_src_branch/gdb/gdb-7.8.x/gdb/dwarf2read.c 2014-11-12 14:45:11.000000000 -0800 @@ -2983,7 +2983,11 @@ { /* 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) { Before: (gdb) pt obj type = const struct (anonymous namespace)::ObjFile { char *filename; const void *start_addr; const void *end_addr; int fd; int elf_type; Elf64_Ehdr elf_header; public: ObjFile(void); } & 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 = const struct (anonymous namespace)::ObjFile { char *filename; const void *start_addr; const void *end_addr; int fd; int elf_type; Elf64_Ehdr elf_header; public: ObjFile(void); } & 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) This is with warm caches so wall time is close to cpu time. If caches aren't warm (fresh build) the difference is even more pronounced. -- You are receiving this mail because: You are on the CC list for the bug.