aboutsummaryrefslogtreecommitdiff
path: root/gdb/coffread.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-05-18 15:56:03 -0600
committerTom Tromey <tom@tromey.com>2019-08-06 20:08:48 -0600
commit021887d88a040cf39f3afbd7da10bbe3ff1ad6c3 (patch)
treefff72470225d1f60510c029d5e61fdeadcf32f38 /gdb/coffread.c
parentb3c6d7ff98954032a3e7989dbd1f50f041e010bb (diff)
downloadgdb-021887d88a040cf39f3afbd7da10bbe3ff1ad6c3.zip
gdb-021887d88a040cf39f3afbd7da10bbe3ff1ad6c3.tar.gz
gdb-021887d88a040cf39f3afbd7da10bbe3ff1ad6c3.tar.bz2
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.
Diffstat (limited to 'gdb/coffread.c')
-rw-r--r--gdb/coffread.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 0c7c4b5..e24ab8d 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -2019,9 +2019,7 @@ coff_read_struct_type (int index, int length, int lastsym,
list = newobj;
/* Save the data. */
- list->field.name
- = (const char *) obstack_copy0 (&objfile->objfile_obstack,
- name, strlen (name));
+ list->field.name = obstack_strdup (&objfile->objfile_obstack, name);
FIELD_TYPE (list->field) = decode_type (ms, ms->c_type,
&sub_aux, objfile);
SET_FIELD_BITPOS (list->field, 8 * ms->c_value);
@@ -2037,9 +2035,7 @@ coff_read_struct_type (int index, int length, int lastsym,
list = newobj;
/* Save the data. */
- list->field.name
- = (const char *) obstack_copy0 (&objfile->objfile_obstack,
- name, strlen (name));
+ list->field.name = obstack_strdup (&objfile->objfile_obstack, name);
FIELD_TYPE (list->field) = decode_type (ms, ms->c_type,
&sub_aux, objfile);
SET_FIELD_BITPOS (list->field, ms->c_value);
@@ -2109,8 +2105,7 @@ coff_read_enum_type (int index, int length, int lastsym,
case C_MOE:
sym = allocate_symbol (objfile);
- name = (char *) obstack_copy0 (&objfile->objfile_obstack, name,
- strlen (name));
+ name = obstack_strdup (&objfile->objfile_obstack, name);
SYMBOL_SET_LINKAGE_NAME (sym, name);
SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;