This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug symtab/17591] dwarf2read.c:find_slot_in_mapped_hash needs to handle "(anonymous namespace)"


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]