From 84a1243b15122dfe6414a4f9bdd82096b37bc625 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 7 Oct 2013 19:40:38 +0000 Subject: move the demangled_names_hash into the per-BFD This moves the demangled_names_hash from the objfile into the per-BFD object. This is part of the objfile splitting project. The demangled names hash is independent of the program space. And, it is needed by the symbol tables. Both of these things indicate that it must be pushed into the per-BFD object, which this patch does. Built and regtested on x86-64 Fedora 18. * objfiles.c (free_objfile_per_bfd_storage): Delete the demangled_names_hash. (free_objfile): Don't delete the demangled_names_hash. * objfiles.h (struct objfile_per_bfd_storage) : New field. (struct objfile) : Move to objfile_per_bfd_storage. * symfile.c (reread_symbols): Don't delete the demangled_names_hash. * symtab.c (create_demangled_names_hash): Update. (symbol_set_names): Update. --- gdb/objfiles.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/objfiles.c') diff --git a/gdb/objfiles.c b/gdb/objfiles.c index b9bcfd7..a10540a 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -168,6 +168,8 @@ free_objfile_per_bfd_storage (struct objfile_per_bfd_storage *storage) { bcache_xfree (storage->filename_cache); bcache_xfree (storage->macro_cache); + if (storage->demangled_names_hash) + htab_delete (storage->demangled_names_hash); obstack_free (&storage->storage_obstack, 0); } @@ -655,8 +657,6 @@ free_objfile (struct objfile *objfile) xfree (objfile->static_psymbols.list); /* Free the obstacks for non-reusable objfiles. */ psymbol_bcache_free (objfile->psymbol_cache); - if (objfile->demangled_names_hash) - htab_delete (objfile->demangled_names_hash); obstack_free (&objfile->objfile_obstack, 0); /* Rebuild section map next time we need it. */ -- cgit v1.1