aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2024-06-19 11:12:28 +0100
committerAndrew Burgess <aburgess@redhat.com>2024-06-27 15:15:25 +0100
commit88aad97c21de7a39f8e63467674ef936b3e9a86d (patch)
tree0e16dd7c4311ff0af6108ff717a182b4de618740 /gdb
parent973563710c2f7c184fb6769e1b1d0fc5f3f181f5 (diff)
downloadbinutils-88aad97c21de7a39f8e63467674ef936b3e9a86d.zip
binutils-88aad97c21de7a39f8e63467674ef936b3e9a86d.tar.gz
binutils-88aad97c21de7a39f8e63467674ef936b3e9a86d.tar.bz2
gdb: add overloads of gdb_abspath
Add two overloads of gdb_abspath, one which takes std::string and one which takes gdb::unique_xmalloc_ptr<char>, then make use of these overloads throughout GDB and gdbserver. There should be no user visible changes after this commit. Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/bsd-kvm.c2
-rw-r--r--gdb/corelow.c2
-rw-r--r--gdb/dwarf2/index-cache.c2
-rw-r--r--gdb/main.c2
-rw-r--r--gdb/top.c2
-rw-r--r--gdb/tracefile-tfile.c2
6 files changed, 6 insertions, 6 deletions
diff --git a/gdb/bsd-kvm.c b/gdb/bsd-kvm.c
index 7ef8c34..19353eb 100644
--- a/gdb/bsd-kvm.c
+++ b/gdb/bsd-kvm.c
@@ -117,7 +117,7 @@ bsd_kvm_target_open (const char *arg, int from_tty)
{
filename = gdb_tilde_expand (arg);
if (!IS_ABSOLUTE_PATH (filename))
- filename = gdb_abspath (filename.c_str ());
+ filename = gdb_abspath (filename);
}
const char *execfile = current_program_space->exec_filename ();
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 49da9be..2b7a355 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -626,7 +626,7 @@ core_target_open (const char *arg, int from_tty)
gdb::unique_xmalloc_ptr<char> filename (tilde_expand (arg));
if (strlen (filename.get ()) != 0
&& !IS_ABSOLUTE_PATH (filename.get ()))
- filename = make_unique_xstrdup (gdb_abspath (filename.get ()).c_str ());
+ filename = make_unique_xstrdup (gdb_abspath (filename).c_str ());
flags = O_BINARY | O_LARGEFILE;
if (write_files)
diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c
index 1720e92..c11b016 100644
--- a/gdb/dwarf2/index-cache.c
+++ b/gdb/dwarf2/index-cache.c
@@ -324,7 +324,7 @@ set_index_cache_directory_command (const char *arg, int from_tty,
cmd_list_element *element)
{
/* Make sure the index cache directory is absolute and tilde-expanded. */
- index_cache_directory = gdb_abspath (index_cache_directory.c_str ());
+ index_cache_directory = gdb_abspath (index_cache_directory);
global_index_cache.set_directory (index_cache_directory);
}
diff --git a/gdb/main.c b/gdb/main.c
index 4dd68f3..e4a40c5 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -121,7 +121,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_datadir = gdb_abspath (gdb_datadir.c_str ());
+ gdb_datadir = gdb_abspath (gdb_datadir);
}
/* Relocate a file or directory. PROGNAME is the name by which gdb
diff --git a/gdb/top.c b/gdb/top.c
index 6239c19..d6bf1d4 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -2097,7 +2097,7 @@ set_history_filename (const char *args,
that was read. */
if (!history_filename.empty ()
&& !IS_ABSOLUTE_PATH (history_filename.c_str ()))
- history_filename = gdb_abspath (history_filename.c_str ());
+ history_filename = gdb_abspath (history_filename);
}
/* Whether we're in quiet startup mode. */
diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c
index eb879c1..4a4c4a2 100644
--- a/gdb/tracefile-tfile.c
+++ b/gdb/tracefile-tfile.c
@@ -467,7 +467,7 @@ tfile_target_open (const char *arg, int from_tty)
gdb::unique_xmalloc_ptr<char> filename (tilde_expand (arg));
if (!IS_ABSOLUTE_PATH (filename.get ()))
- filename = make_unique_xstrdup (gdb_abspath (filename.get ()).c_str ());
+ filename = make_unique_xstrdup (gdb_abspath (filename).c_str ());
flags = O_BINARY | O_LARGEFILE;
flags |= O_RDONLY;