summaryrefslogtreecommitdiff
path: root/gdb/minsyms.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2003-02-04 18:07:01 +0000
committerDaniel Jacobowitz <drow@false.org>2003-02-04 18:07:01 +0000
commit2de7ced7074964728e66d7a71af0d4fb28f28fa9 (patch)
tree13fb1875f9f0b42bc9ac58a32d828fefb6e7ad11 /gdb/minsyms.c
parent266fb683100e69fad79f5bb7ed260de5e2eff655 (diff)
downloadbinutils-gdb-2de7ced7074964728e66d7a71af0d4fb28f28fa9.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/minsyms.c')
-rw-r--r--gdb/minsyms.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 92dfa8296bb..e4b0596e9a3 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -612,9 +612,10 @@ prim_record_minimal_symbol_and_info (const char *name, CORE_ADDR address,
msym_bunch = new;
}
msymbol = &msym_bunch->contents[msym_bunch_index];
- SYMBOL_NAME (msymbol) = obsavestring ((char *) name, strlen (name),
- &objfile->symbol_obstack);
SYMBOL_INIT_LANGUAGE_SPECIFIC (msymbol, language_unknown);
+ SYMBOL_LANGUAGE (msymbol) = language_auto;
+ SYMBOL_SET_NAMES (msymbol, (char *)name, strlen (name), objfile);
+
SYMBOL_VALUE_ADDRESS (msymbol) = address;
SYMBOL_SECTION (msymbol) = section;
SYMBOL_BFD_SECTION (msymbol) = bfd_section;
@@ -866,7 +867,6 @@ install_minimal_symbols (struct objfile *objfile)
for (bindex = 0; bindex < msym_bunch_index; bindex++, mcount++)
{
msymbols[mcount] = bunch->contents[bindex];
- SYMBOL_LANGUAGE (&msymbols[mcount]) = language_auto;
if (SYMBOL_NAME (&msymbols[mcount])[0] == leading_char)
{
SYMBOL_NAME (&msymbols[mcount])++;
@@ -926,11 +926,6 @@ install_minimal_symbols (struct objfile *objfile)
}
}
}
-
- /* Now walk through all the minimal symbols, selecting the newly added
- ones and attempting to cache their C++ demangled names. */
- for (; mcount-- > 0; msymbols++)
- SYMBOL_INIT_DEMANGLED_NAME (msymbols, &objfile->symbol_obstack);
/* Now build the hash tables; we can't do this incrementally
at an earlier point since we weren't finished with the obstack