From ace4b8d75a3bd81cdaf61a0fec307d631388470d Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Mon, 8 Jul 1996 09:05:18 +0000 Subject: (laying some groundwork for a fix for PR 8443) * coffread.c (record_minimal_symbol): Don't presave name string on symbol_obstack before passing to prim_record_minimal_symbol. It now handles saving the string itself. * dbxread.c (read_dbx_dynamic_symtab): Ditto. * mipsread.c (read_alphacoff_dynamic_symtab): Ditto. * os9kread.c (record_minimal_symbol): Ditto. * solib.c (solib_add_common_symbols): Ditto. * coffread.c (coff_symtab_read): Don't presave name string on symbol_obstack before passing to prim_record_minimal_symbol_and_info. It now handles saving the string itself. * dbxread.c (record_minimal_symbol): Ditto. * elfread.c (record_minimal_symbol_and_info): Ditto. * dstread.c (record_minimal_symbol): Remove static function that just called prim_record_minimal_symbol with the same args (after change to prim_record_minimal_symbol to do it's own name string saves). * nlmread.c (record_minimal_symbol): Ditto. * somread.c (record_minimal_symbol): Ditto. * hpread.c (hpread_read_enum_type): Save symbol name on symbol obstack. (hpread_read_function_type): Ditto. (hpread_process_one_debug_symbol): Ditto. * mdebugread.c (parse_symbol): Ditto. (new_symbol): Ditto. * minsyms.c (prim_record_minimal_symbol_and_info): Ditto. * coffread.c (process_coff_symbol): Use obsavestring to save SYMBOL_NAME, rather than obstack_copy0. * dstread.c (create_new_symbol): Ditto * symfile.c (obconcat): Ditto. * stabsread.c (patch_block_stabs): Ditto. * xcoffread.c (SYMNAME_ALLOC): Ditto. * symfile.c (obsavestring): Update comments * solib.c (solib_add_common_symbols): Remove local var origname. --- gdb/mdebugread.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gdb/mdebugread.c') diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 89015ba..927c796 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -1114,7 +1114,9 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets) obstack_alloc (¤t_objfile->symbol_obstack, sizeof (struct symbol))); memset ((PTR) enum_sym, 0, sizeof (struct symbol)); - SYMBOL_NAME (enum_sym) = f->name; + SYMBOL_NAME (enum_sym) = + obsavestring (f->name, strlen (f->name), + ¤t_objfile->symbol_obstack); SYMBOL_CLASS (enum_sym) = LOC_CONST; SYMBOL_TYPE (enum_sym) = t; SYMBOL_NAMESPACE (enum_sym) = VAR_NAMESPACE; @@ -4099,7 +4101,8 @@ new_symbol (name) sizeof (struct symbol))); memset ((PTR) s, 0, sizeof (*s)); - SYMBOL_NAME (s) = name; + SYMBOL_NAME (s) = obsavestring (name, strlen (name), + ¤t_objfile->symbol_obstack); SYMBOL_LANGUAGE (s) = psymtab_language; SYMBOL_INIT_DEMANGLED_NAME (s, ¤t_objfile->symbol_obstack); return s; -- cgit v1.1