summaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2022-04-13 17:31:02 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2022-04-18 15:48:03 -0400
commit7ab2607f97e5deaeae91018edf3ef5b4255a842c (patch)
treef1fea75412b59b147691af35019eb6d940f062b0 /gdb/main.c
parente0c34637019b0a070780b57b50d9026c0aca16f4 (diff)
downloadbinutils-gdb-7ab2607f97e5deaeae91018edf3ef5b4255a842c.tar.gz
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
Diffstat (limited to 'gdb/main.c')
-rw-r--r--gdb/main.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/gdb/main.c b/gdb/main.c
index 8c0807ff83b..ec2b7b01752 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -133,12 +133,7 @@ set_gdb_data_directory (const char *new_datadir)
"../foo" and "../foo" doesn't exist then we'll record $(pwd)/../foo which
isn't canonical, but that's ok. */
if (!IS_ABSOLUTE_PATH (gdb_datadir.c_str ()))
- {
- gdb::unique_xmalloc_ptr<char> abs_datadir
- = gdb_abspath (gdb_datadir.c_str ());
-
- gdb_datadir = abs_datadir.get ();
- }
+ gdb_datadir = gdb_abspath (gdb_datadir.c_str ());
}
/* Relocate a file or directory. PROGNAME is the name by which gdb