aboutsummaryrefslogtreecommitdiff
path: root/gdb/compile
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/compile
parente0c34637019b0a070780b57b50d9026c0aca16f4 (diff)
downloadfsf-binutils-gdb-7ab2607f97e5deaeae91018edf3ef5b4255a842c.zip
fsf-binutils-gdb-7ab2607f97e5deaeae91018edf3ef5b4255a842c.tar.gz
fsf-binutils-gdb-7ab2607f97e5deaeae91018edf3ef5b4255a842c.tar.bz2
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/compile')
-rw-r--r--gdb/compile/compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c
index 2a1f0f1..5cbb341 100644
--- a/gdb/compile/compile.c
+++ b/gdb/compile/compile.c
@@ -297,8 +297,8 @@ compile_file_command (const char *args, int from_tty)
error (_("You must provide a filename for this command."));
args = skip_spaces (args);
- gdb::unique_xmalloc_ptr<char> abspath = gdb_abspath (args);
- std::string buffer = string_printf ("#include \"%s\"\n", abspath.get ());
+ std::string abspath = gdb_abspath (args);
+ std::string buffer = string_printf ("#include \"%s\"\n", abspath.c_str ());
eval_compile_command (NULL, buffer.c_str (), scope, NULL);
}