mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-16 14:45:06 +08:00
gdbsupport: make gdb_abspath return an std::string
I'm trying to switch these functions to use std::string instead of char arrays, as much as possible. Some callers benefit from it (can avoid doing a copy of the result), while others suffer (have to make one more copy). Change-Id: Iced49b8ee2f189744c5072a3b217aab5af17a993
This commit is contained in:

committed by
Simon Marchi

parent
e0c3463701
commit
7ab2607f97
@ -331,7 +331,7 @@ objfile::objfile (bfd *abfd, const char *name, objfile_flags flags_)
|
||||
|
||||
objfile_alloc_data (this);
|
||||
|
||||
gdb::unique_xmalloc_ptr<char> name_holder;
|
||||
std::string name_holder;
|
||||
if (name == NULL)
|
||||
{
|
||||
gdb_assert (abfd == NULL);
|
||||
@ -344,7 +344,7 @@ objfile::objfile (bfd *abfd, const char *name, objfile_flags flags_)
|
||||
else
|
||||
{
|
||||
name_holder = gdb_abspath (name);
|
||||
expanded_name = name_holder.get ();
|
||||
expanded_name = name_holder.c_str ();
|
||||
}
|
||||
original_name = obstack_strdup (&objfile_obstack, expanded_name);
|
||||
|
||||
|
Reference in New Issue
Block a user