diff options
author | Tom Tromey <tom@tromey.com> | 2019-05-18 15:56:03 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-08-06 20:08:48 -0600 |
commit | 021887d88a040cf39f3afbd7da10bbe3ff1ad6c3 (patch) | |
tree | fff72470225d1f60510c029d5e61fdeadcf32f38 /gdb/c-exp.y | |
parent | b3c6d7ff98954032a3e7989dbd1f50f041e010bb (diff) | |
download | gdb-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/c-exp.y')
-rw-r--r-- | gdb/c-exp.y | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 47e82b6..439a72a 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -2490,15 +2490,14 @@ static const struct token ident_tokens[] = static void scan_macro_expansion (char *expansion) { - char *copy; + const char *copy; /* We'd better not be trying to push the stack twice. */ gdb_assert (! cpstate->macro_original_text); /* Copy to the obstack, and then free the intermediate expansion. */ - copy = (char *) obstack_copy0 (&cpstate->expansion_obstack, expansion, - strlen (expansion)); + copy = obstack_strdup (&cpstate->expansion_obstack, expansion); xfree (expansion); /* Save the old lexptr value, so we can return to it when we're done |