From 7ab2607f97e5deaeae91018edf3ef5b4255a842c Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 13 Apr 2022 17:31:02 -0400 Subject: 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 --- gdb/top.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'gdb/top.c') diff --git a/gdb/top.c b/gdb/top.c index e776ac2..1cfffbe 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -2167,12 +2167,7 @@ set_history_filename (const char *args, that was read. */ if (!history_filename.empty () && !IS_ABSOLUTE_PATH (history_filename.c_str ())) - { - gdb::unique_xmalloc_ptr temp - (gdb_abspath (history_filename.c_str ())); - - history_filename = temp.get (); - } + history_filename = gdb_abspath (history_filename.c_str ()); } /* Whether we're in quiet startup mode. */ @@ -2444,7 +2439,6 @@ _initialize_top () const char *fname = ".gdb_history"; #endif - gdb::unique_xmalloc_ptr temp (gdb_abspath (fname)); - history_filename = temp.get (); + history_filename = gdb_abspath (fname); } } -- cgit v1.1