mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-05 21:50:21 +08:00
Use obstack_strdup more
This changes gdb to use obstack_strdup when appropriate, rather than the wordier obstack_copy0. gdb/ChangeLog 2019-08-06 Tom Tromey <tom@tromey.com> * xcoffread.c (SYMNAME_ALLOC, process_xcoff_symbol): Use obstack_strdup. * typeprint.c (typedef_hash_table::find_global_typedef): Use obstack_strdup. * symfile.c (allocate_compunit_symtab): Use obstack_strdup. * stabsread.c (common_block_start): Use obstack_strdup. * objfiles.c (set_objfile_main_name, objfile): Use obstack_strdup. * namespace.c (add_using_directive): Use obstack_strdup. * mdebugread.c (parse_symbol, parse_type): Use obstack_strdup. * jit.c (finalize_symtab): Use obstack_strdup. * dwarf2read.c (fixup_go_packaging, dwarf2_physname) (guess_partial_die_structure_name, partial_die_info::fixup) (dwarf2_name): Use obstack_strdup. * coffread.c (coff_read_struct_type, coff_read_enum_type): Use obstack_strdup. * c-exp.y (scan_macro_expansion): Use obstack_strdup. * buildsym.c (buildsym_compunit::end_symtab_with_blockvector): Use obstack_strdup. * ada-lang.c (ada_decode_symbol): Use obstack_strdup.
This commit is contained in:
@ -1031,9 +1031,8 @@ buildsym_compunit::end_symtab_with_blockvector (struct block *static_block,
|
||||
{
|
||||
/* Reallocate the dirname on the symbol obstack. */
|
||||
const char *comp_dir = m_comp_dir.get ();
|
||||
COMPUNIT_DIRNAME (cu)
|
||||
= (const char *) obstack_copy0 (&m_objfile->objfile_obstack,
|
||||
comp_dir, strlen (comp_dir));
|
||||
COMPUNIT_DIRNAME (cu) = obstack_strdup (&m_objfile->objfile_obstack,
|
||||
comp_dir);
|
||||
}
|
||||
|
||||
/* Save the debug format string (if any) in the symtab. */
|
||||
|
Reference in New Issue
Block a user