This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
FYI: put ELF minsym file name into filename bcache
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 21 Dec 2011 14:30:11 -0700
- Subject: FYI: put ELF minsym file name into filename bcache
I'm checking this in on the trunk.
This is extracted from patch 16 in my recent series:
http://sourceware.org/ml/gdb-patches/2011-12/msg00492.html
This just changes elfread to put the minimal symbol file name, if there
is one, into the filename bcache.
Tom
2011-12-21 Tom Tromey <tromey@redhat.com>
* elfread.c (elf_symtab_read): Put the filename in the filename
bcache.
Index: elfread.c
===================================================================
RCS file: /cvs/src/src/gdb/elfread.c,v
retrieving revision 1.121
diff -u -r1.121 elfread.c
--- elfread.c 19 Dec 2011 04:36:29 -0000 1.121
+++ elfread.c 21 Dec 2011 21:29:01 -0000
@@ -43,6 +43,7 @@
#include "infcall.h"
#include "gdbthread.h"
#include "regcache.h"
+#include "bcache.h"
extern void _initialize_elfread (void);
@@ -240,8 +241,8 @@
seen any section info for it yet. */
asymbol *filesym = 0;
/* Name of filesym. This is either a constant string or is saved on
- the objfile's obstack. */
- char *filesymname = "";
+ the objfile's filename cache. */
+ const char *filesymname = "";
struct dbx_symfile_info *dbx = objfile->deprecated_sym_stab_info;
int stripped = (bfd_get_symcount (objfile->obfd) == 0);
@@ -346,9 +347,8 @@
sectinfo = NULL;
}
filesym = sym;
- filesymname =
- obsavestring ((char *) filesym->name, strlen (filesym->name),
- &objfile->objfile_obstack);
+ filesymname = bcache (filesym->name, strlen (filesym->name) + 1,
+ objfile->filename_cache);
}
else if (sym->flags & BSF_SECTION_SYM)
continue;