diff options
author | Tom Tromey <tom@tromey.com> | 2019-07-13 12:09:51 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-08-06 20:08:48 -0600 |
commit | efba19b06a6f2baacb3920599f970d1333ffc358 (patch) | |
tree | f8ab8d8f5a212c00950b8fc67a180e4373017f01 /gdb/symfile.c | |
parent | f25102f7b100337923d2c81ecc12a64d428e98fe (diff) | |
download | gdb-efba19b06a6f2baacb3920599f970d1333ffc358.zip gdb-efba19b06a6f2baacb3920599f970d1333ffc358.tar.gz gdb-efba19b06a6f2baacb3920599f970d1333ffc358.tar.bz2 |
Add obstack_strdup overload taking a std::string
This adds an obstack_strdup overload that takes a std::string, and
changes a few spots in gdb to use it.
gdb/ChangeLog
2019-08-06 Tom Tromey <tom@tromey.com>
* symfile.c (reread_symbols): Use obstack_strdup.
* stabsread.c (read_type): Use obstack_strdup.
* gdb_obstack.h (obstack_strdup): New overload.
* dwarf2read.c (dwarf2_compute_name, create_dwo_unit_in_dwp_v1)
(create_dwo_unit_in_dwp_v2, build_error_marker_type)
(dwarf2_canonicalize_name): Use obstack_strdup.
* dbxread.c (read_dbx_symtab): Use obstack_strdup.
* cp-support.c (inspect_type, replace_typedefs_qualified_name):
Use obstack_strdup.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r-- | gdb/symfile.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c index b927de5..8843781 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2596,9 +2596,7 @@ reread_symbols (void) set_objfile_per_bfd (objfile); objfile->original_name - = (char *) obstack_copy0 (&objfile->objfile_obstack, - original_name.c_str (), - original_name.size ()); + = obstack_strdup (&objfile->objfile_obstack, original_name); /* Reset the sym_fns pointer. The ELF reader can change it based on whether .gdb_index is present, and we need it to |