diff options
author | Tom Tromey <tromey@redhat.com> | 2012-08-22 16:01:09 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2012-08-22 16:01:09 +0000 |
commit | 706e37059fbfed5beb9fe02921483809dfd86e5b (patch) | |
tree | d604042d166fc7545502657f9171d6210f4acc9e /gdb/symfile.c | |
parent | e992eda4f6cece4cccbad807b1307168de924174 (diff) | |
download | gdb-706e37059fbfed5beb9fe02921483809dfd86e5b.zip gdb-706e37059fbfed5beb9fe02921483809dfd86e5b.tar.gz gdb-706e37059fbfed5beb9fe02921483809dfd86e5b.tar.bz2 |
* elfread.c (elf_symtab_read): Update.
* objfiles.c (objfiles_bfd_data): New global.
(get_objfile_bfd_data, free_objfile_per_bfd_storage)
(objfile_bfd_data_free, set_objfile_per_bfd): New functions.
(allocate_objfile, free_objfile): Update.
(_initialize_objfiles): Initialize objfiles_bfd_data.
* objfiles.h (struct objfile_per_bfd_storage): New.
(struct objfile) <per_bfd>: New field.
<filename_cache>: Remove.
(set_objfile_per_bfd): Declare.
* symfile.c (reread_symbols): Update. Call
set_objfile_per_bfd.
(allocate_symtab): Update.
* symmisc.c (print_symbol_bcache_statistics): Update.
(print_objfile_statistics): Print the size of the BFD obstack.
gdb/testsuite
* gdb.base/maint.exp: Update.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r-- | gdb/symfile.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c index d070e48..6ef1ac1 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2550,8 +2550,6 @@ reread_symbols (void) objfile->psymbol_cache = psymbol_bcache_init (); bcache_xfree (objfile->macro_cache); objfile->macro_cache = bcache_xmalloc (NULL, NULL); - bcache_xfree (objfile->filename_cache); - objfile->filename_cache = bcache_xmalloc (NULL,NULL); if (objfile->demangled_names_hash != NULL) { htab_delete (objfile->demangled_names_hash); @@ -2572,6 +2570,8 @@ reread_symbols (void) memset (&objfile->msymbol_demangled_hash, 0, sizeof (objfile->msymbol_demangled_hash)); + set_objfile_per_bfd (objfile); + /* obstack_init also initializes the obstack so it is empty. We could use obstack_specify_allocation but gdb_obstack.h specifies the alloc/dealloc functions. */ @@ -2856,7 +2856,7 @@ allocate_symtab (const char *filename, struct objfile *objfile) obstack_alloc (&objfile->objfile_obstack, sizeof (struct symtab)); memset (symtab, 0, sizeof (*symtab)); symtab->filename = (char *) bcache (filename, strlen (filename) + 1, - objfile->filename_cache); + objfile->per_bfd->filename_cache); symtab->fullname = NULL; symtab->language = deduce_language_from_filename (filename); symtab->debugformat = "unknown"; |