aboutsummaryrefslogtreecommitdiff
path: root/gdbserver
diff options
context:
space:
mode:
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2021-04-12 14:14:06 +0200
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2021-04-12 16:36:25 +0200
commit04977957ecfc723bc4f57460e8e4eed7e6b69f32 (patch)
treef81ccf59234a4a9aa2f325d6b6d31995229a359a /gdbserver
parent9d8f30221b70361930fb82bf81e448b82f36cd58 (diff)
downloadfsf-binutils-gdb-04977957ecfc723bc4f57460e8e4eed7e6b69f32.zip
fsf-binutils-gdb-04977957ecfc723bc4f57460e8e4eed7e6b69f32.tar.gz
fsf-binutils-gdb-04977957ecfc723bc4f57460e8e4eed7e6b69f32.tar.bz2
gdbserver: constify the 'pid_to_exec_file' target op
gdbserver/ChangeLog: 2021-04-12 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * target.h (class process_stratum_target) <pid_to_exec_file>: Constify the return type. Update the definition/references below. * target.cc (process_stratum_target::pid_to_exec_file) * linux-low.h (class linux_process_target) <pid_to_exec_file> * linux-low.cc (linux_process_target::pid_to_exec_file) * netbsd-low.h (class netbsd_process_target) <pid_to_exec_file> * netbsd-low.cc (netbsd_process_target::pid_to_exec_file) * server.cc (handle_qxfer_exec_file)
Diffstat (limited to 'gdbserver')
-rw-r--r--gdbserver/ChangeLog11
-rw-r--r--gdbserver/linux-low.cc2
-rw-r--r--gdbserver/linux-low.h2
-rw-r--r--gdbserver/netbsd-low.cc4
-rw-r--r--gdbserver/netbsd-low.h2
-rw-r--r--gdbserver/server.cc3
-rw-r--r--gdbserver/target.cc2
-rw-r--r--gdbserver/target.h2
8 files changed, 19 insertions, 9 deletions
diff --git a/gdbserver/ChangeLog b/gdbserver/ChangeLog
index 029a2e4..7692979 100644
--- a/gdbserver/ChangeLog
+++ b/gdbserver/ChangeLog
@@ -1,3 +1,14 @@
+2021-04-12 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
+
+ * target.h (class process_stratum_target) <pid_to_exec_file>:
+ Constify the return type. Update the definition/references below.
+ * target.cc (process_stratum_target::pid_to_exec_file)
+ * linux-low.h (class linux_process_target) <pid_to_exec_file>
+ * linux-low.cc (linux_process_target::pid_to_exec_file)
+ * netbsd-low.h (class netbsd_process_target) <pid_to_exec_file>
+ * netbsd-low.cc (netbsd_process_target::pid_to_exec_file)
+ * server.cc (handle_qxfer_exec_file)
+
2021-04-11 Eli Zaretskii <eliz@gnu.org>
* win32-low.cc (win32_add_dll): New function, with body almost
diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc
index 0baac01..251a54f 100644
--- a/gdbserver/linux-low.cc
+++ b/gdbserver/linux-low.cc
@@ -6265,7 +6265,7 @@ linux_process_target::supports_pid_to_exec_file ()
return true;
}
-char *
+const char *
linux_process_target::pid_to_exec_file (int pid)
{
return linux_proc_pid_to_exec_file (pid);
diff --git a/gdbserver/linux-low.h b/gdbserver/linux-low.h
index be97526..d59ad38 100644
--- a/gdbserver/linux-low.h
+++ b/gdbserver/linux-low.h
@@ -292,7 +292,7 @@ public:
bool supports_pid_to_exec_file () override;
- char *pid_to_exec_file (int pid) override;
+ const char *pid_to_exec_file (int pid) override;
bool supports_multifs () override;
diff --git a/gdbserver/netbsd-low.cc b/gdbserver/netbsd-low.cc
index 38ded94..84e34d0 100644
--- a/gdbserver/netbsd-low.cc
+++ b/gdbserver/netbsd-low.cc
@@ -1193,10 +1193,10 @@ netbsd_process_target::supports_qxfer_libraries_svr4 ()
/* Return the name of a file that can be opened to get the symbols for
the child process identified by PID. */
-char *
+const char *
netbsd_process_target::pid_to_exec_file (pid_t pid)
{
- return const_cast<char *> (netbsd_nat::pid_to_exec_file (pid));
+ return netbsd_nat::pid_to_exec_file (pid);
}
/* Implementation of the target_ops method "supports_pid_to_exec_file". */
diff --git a/gdbserver/netbsd-low.h b/gdbserver/netbsd-low.h
index 9c341c7..b98588f 100644
--- a/gdbserver/netbsd-low.h
+++ b/gdbserver/netbsd-low.h
@@ -121,7 +121,7 @@ public:
bool supports_pid_to_exec_file () override;
- char *pid_to_exec_file (int pid) override;
+ const char *pid_to_exec_file (int pid) override;
const char *thread_name (ptid_t thread) override;
diff --git a/gdbserver/server.cc b/gdbserver/server.cc
index 2a44330..a5d9f85 100644
--- a/gdbserver/server.cc
+++ b/gdbserver/server.cc
@@ -1466,7 +1466,6 @@ handle_qxfer_exec_file (const char *annex,
gdb_byte *readbuf, const gdb_byte *writebuf,
ULONGEST offset, LONGEST len)
{
- char *file;
ULONGEST pid;
int total_len;
@@ -1490,7 +1489,7 @@ handle_qxfer_exec_file (const char *annex,
if (pid <= 0)
return -1;
- file = the_target->pid_to_exec_file (pid);
+ const char *file = the_target->pid_to_exec_file (pid);
if (file == NULL)
return -1;
diff --git a/gdbserver/target.cc b/gdbserver/target.cc
index 1f21597..5ec3e5c 100644
--- a/gdbserver/target.cc
+++ b/gdbserver/target.cc
@@ -783,7 +783,7 @@ process_stratum_target::supports_pid_to_exec_file ()
return false;
}
-char *
+const char *
process_stratum_target::pid_to_exec_file (int pid)
{
gdb_assert_not_reached ("target op pid_to_exec_file not supported");
diff --git a/gdbserver/target.h b/gdbserver/target.h
index 2831a6c..769d828 100644
--- a/gdbserver/target.h
+++ b/gdbserver/target.h
@@ -440,7 +440,7 @@ public:
character string containing the pathname is returned. This
string should be copied into a buffer by the client if the string
will not be immediately used, or if it must persist. */
- virtual char *pid_to_exec_file (int pid);
+ virtual const char *pid_to_exec_file (int pid);
/* Return true if any of the multifs ops is supported. */
virtual bool supports_multifs ();