diff options
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r-- | gdb/symfile.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c index d087b1f..2a68201 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -40,6 +40,7 @@ #include "gdb-stabs.h" #include "obstack.h" #include "completer.h" +#include "bcache.h" #include <sys/types.h> #include <fcntl.h> @@ -1740,8 +1741,10 @@ reread_symbols (void) sizeof (objfile->static_psymbols)); /* Free the obstacks for non-reusable objfiles */ - free_bcache (&objfile->psymbol_cache); - free_bcache (&objfile->macro_cache); + bcache_xfree (objfile->psymbol_cache); + objfile->psymbol_cache = bcache_xmalloc (); + bcache_xfree (objfile->macro_cache); + objfile->macro_cache = bcache_xmalloc (); obstack_free (&objfile->psymbol_obstack, 0); obstack_free (&objfile->symbol_obstack, 0); obstack_free (&objfile->type_obstack, 0); @@ -1765,10 +1768,8 @@ reread_symbols (void) objfile->md = NULL; /* obstack_specify_allocation also initializes the obstack so it is empty. */ - obstack_specify_allocation (&objfile->psymbol_cache.cache, 0, 0, - xmalloc, xfree); - obstack_specify_allocation (&objfile->macro_cache.cache, 0, 0, - xmalloc, xfree); + objfile->psymbol_cache = bcache_xmalloc (); + objfile->macro_cache = bcache_xmalloc (); obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0, xmalloc, xfree); obstack_specify_allocation (&objfile->symbol_obstack, 0, 0, @@ -2377,7 +2378,7 @@ add_psymbol_to_list (char *name, int namelength, namespace_enum namespace, /* Create local copy of the partial symbol */ memcpy (buf, name, namelength); buf[namelength] = '\0'; - SYMBOL_NAME (&psymbol) = bcache (buf, namelength + 1, &objfile->psymbol_cache); + SYMBOL_NAME (&psymbol) = bcache (buf, namelength + 1, objfile->psymbol_cache); /* val and coreaddr are mutually exclusive, one of them *will* be zero */ if (val != 0) { @@ -2394,7 +2395,7 @@ add_psymbol_to_list (char *name, int namelength, namespace_enum namespace, SYMBOL_INIT_LANGUAGE_SPECIFIC (&psymbol, language); /* Stash the partial symbol away in the cache */ - psym = bcache (&psymbol, sizeof (struct partial_symbol), &objfile->psymbol_cache); + psym = bcache (&psymbol, sizeof (struct partial_symbol), objfile->psymbol_cache); /* Save pointer to partial symbol in psymtab, growing symtab if needed. */ if (list->next >= list->list + list->size) @@ -2429,7 +2430,7 @@ add_psymbol_with_dem_name_to_list (char *name, int namelength, char *dem_name, memcpy (buf, name, namelength); buf[namelength] = '\0'; - SYMBOL_NAME (&psymbol) = bcache (buf, namelength + 1, &objfile->psymbol_cache); + SYMBOL_NAME (&psymbol) = bcache (buf, namelength + 1, objfile->psymbol_cache); buf = alloca (dem_namelength + 1); memcpy (buf, dem_name, dem_namelength); @@ -2440,11 +2441,11 @@ add_psymbol_with_dem_name_to_list (char *name, int namelength, char *dem_name, case language_c: case language_cplus: SYMBOL_CPLUS_DEMANGLED_NAME (&psymbol) = - bcache (buf, dem_namelength + 1, &objfile->psymbol_cache); + bcache (buf, dem_namelength + 1, objfile->psymbol_cache); break; case language_chill: SYMBOL_CHILL_DEMANGLED_NAME (&psymbol) = - bcache (buf, dem_namelength + 1, &objfile->psymbol_cache); + bcache (buf, dem_namelength + 1, objfile->psymbol_cache); /* FIXME What should be done for the default case? Ignoring for now. */ } @@ -2465,7 +2466,7 @@ add_psymbol_with_dem_name_to_list (char *name, int namelength, char *dem_name, SYMBOL_INIT_LANGUAGE_SPECIFIC (&psymbol, language); /* Stash the partial symbol away in the cache */ - psym = bcache (&psymbol, sizeof (struct partial_symbol), &objfile->psymbol_cache); + psym = bcache (&psymbol, sizeof (struct partial_symbol), objfile->psymbol_cache); /* Save pointer to partial symbol in psymtab, growing symtab if needed. */ if (list->next >= list->list + list->size) |