diff options
author | Daniel Jacobowitz <dan@debian.org> | 2003-02-04 18:07:01 +0000 |
---|---|---|
committer | Daniel Jacobowitz <dan@debian.org> | 2003-02-04 18:07:01 +0000 |
commit | 82ace3a4a0877bc96bc36768d06c696ded8dedef (patch) | |
tree | 78f1d9f3970c37a53597e1469d7dff0d9165c62d /gdb/objfiles.c | |
parent | b941e5dcfaa4ab6ed14e76296e87d1952fbdabe8 (diff) | |
download | gdb-82ace3a4a0877bc96bc36768d06c696ded8dedef.tar.gz |
* defs.h (streq): Add prototype.
* utils.c (streq): New function.
* dwarf2read.c (new_symbol): Use SYMBOL_SET_NAMES instead of
SYMBOL_NAME and SYMBOL_INIT_DEMANGLED_NAME.
* mdebugread.c (new_symbol): Likewise.
* stabsread.c (define_symbol): Likewise.
* coffread.c (process_coff_symbol): Likewise.
* dwarfread.c (new_symbol): Likewise.
* minsyms.c (prim_record_minimal_symbol_and_info): Use
SYMBOL_SET_NAMES instead of setting SYMBOL_NAME. Set the language
here.
(install_minimal_symbols): Don't set SYMBOL_LANGUAGE or call
SYMBOL_INIT_DEMANGLED_NAME.
* objfiles.c: Include "hashtab.h".
(allocate_objfile): Call htab_set_functions_ex for the
demangled_names_hash.
(free_objfile): Call htab_delete for the demangled_names_hash.
* objfiles.h (struct htab): Add declaration.
(struct objfile): Add demangled_names_hash.
* symfile.c: Include "hashtab.h".
(reread_symbols): Call htab_delete for the demangled_names_hash.
(add_psymbol_to_list): Use SYMBOL_SET_NAMES instead of putting
SYMBOL_NAME in the bcache.
* symtab.c: Include "hashtab.h". Update comments.
(create_demangled_names_hash, symbol_set_names): New functions.
(symbol_find_demangled_name): New function, broken out from
symbol_init_demangled_names.
(symbol_init_demangled_names): Use it.
* symtab.h (SYMBOL_INIT_DEMANGLED_NAME): Add missing parentheses.
(SYMBOL_SET_NAMES): New macro.
(symbol_set_names): Add prototype.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r-- | gdb/objfiles.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 16d8527a7de..90844018fc4 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -1,7 +1,7 @@ /* GDB routines for manipulating objfiles. Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 Free Software Foundation, Inc. + 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Cygnus Support, using pieces from other GDB modules. @@ -39,6 +39,7 @@ #include <fcntl.h> #include "gdb_obstack.h" #include "gdb_string.h" +#include "hashtab.h" #include "breakpoint.h" @@ -191,6 +192,11 @@ allocate_objfile (bfd *abfd, int flags) objfile->md = md; objfile->mmfd = fd; /* Update pointers to functions to *our* copies */ + if (objfile->demangled_names_hash) + htab_set_functions_ex + (objfile->demangled_names_hash, htab_hash_string, + (int (*) (const void *, const void *)) streq, NULL, + objfile->md, xmcalloc, xmfree); obstack_chunkfun (&objfile->psymbol_cache.cache, xmmalloc); obstack_freefun (&objfile->psymbol_cache.cache, xmfree); obstack_chunkfun (&objfile->macro_cache.cache, xmmalloc); @@ -551,6 +557,8 @@ free_objfile (struct objfile *objfile) /* Free the obstacks for non-reusable objfiles */ bcache_xfree (objfile->psymbol_cache); bcache_xfree (objfile->macro_cache); + if (objfile->demangled_names_hash) + htab_delete (objfile->demangled_names_hash); obstack_free (&objfile->psymbol_obstack, 0); obstack_free (&objfile->symbol_obstack, 0); obstack_free (&objfile->type_obstack, 0); |