]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdbserver: constify the 'pid_to_exec_file' target op
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Mon, 12 Apr 2021 12:14:06 +0000 (14:14 +0200)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Mon, 12 Apr 2021 14:36:25 +0000 (16:36 +0200)
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)

gdbserver/ChangeLog
gdbserver/linux-low.cc
gdbserver/linux-low.h
gdbserver/netbsd-low.cc
gdbserver/netbsd-low.h
gdbserver/server.cc
gdbserver/target.cc
gdbserver/target.h

index 029a2e472f50a16abb18bce540c44785e3deac67..7692979f2513635656ba71fb266781f13f2060ac 100644 (file)
@@ -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
index 0baac013129c19c473096044129f783b4c498d90..251a54f5c4aa0bad78c23405fd1be375a3d876da 100644 (file)
@@ -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);
index be97526ced7b7b7ff8179567c8c519859364866b..d59ad386bd5daccccb9390cdc50424cc7d781c57 100644 (file)
@@ -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;
 
index 38ded94d909f24e54281880d5b410bdad2d1950d..84e34d0e065ea2431ca00b383ec280e2b4efd186 100644 (file)
@@ -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".  */
index 9c341c71cf9006a9983e0de6bf243d2c2a8086fb..b98588fdf33eb04f23e5cc49c13629ba92e19bca 100644 (file)
@@ -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;
 
index 2a443305691063d745e560e9063dab5a44f99644..a5d9f85216d1e2e8bf2823da519dbc494e9ced87 100644 (file)
@@ -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;
 
index 1f2159714b3df80cd6965765eb07c2ed713bb0ba..5ec3e5cce9f9184dd49bfbad9a0b4fb0e1c99bfe 100644 (file)
@@ -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");
index 2831a6ce7c028b92ff91d2787625a1e494a7ef6b..769d82811766572258d352ab99cd1e2c08629de8 100644 (file)
@@ -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 ();