aboutsummaryrefslogtreecommitdiff
path: root/gdb/exec.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2022-04-13 17:39:06 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2022-04-18 15:48:03 -0400
commit5f2491c300636a2091a2ca3db7773d52d04bf566 (patch)
treee85460da53174cd4de6c5b8aad0f8941f6b12f82 /gdb/exec.c
parent7ab2607f97e5deaeae91018edf3ef5b4255a842c (diff)
downloadgdb-5f2491c300636a2091a2ca3db7773d52d04bf566.zip
gdb-5f2491c300636a2091a2ca3db7773d52d04bf566.tar.gz
gdb-5f2491c300636a2091a2ca3db7773d52d04bf566.tar.bz2
gdbsupport: make gdb_realpath_keepfile 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: I793aab17baaef8345488f4c40b9094e2695425bc
Diffstat (limited to 'gdb/exec.c')
-rw-r--r--gdb/exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index 84c3647..38540c0 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -467,7 +467,8 @@ exec_file_attach (const char *filename, int from_tty)
(bfd_get_filename (current_program_space->exec_bfd ())));
else
current_program_space->exec_filename
- = gdb_realpath_keepfile (scratch_pathname);
+ = make_unique_xstrdup (gdb_realpath_keepfile
+ (scratch_pathname).c_str ());
if (!bfd_check_format_matches (current_program_space->exec_bfd (),
bfd_object, &matching))