+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
return true;
}
-char *
+const char *
linux_process_target::pid_to_exec_file (int pid)
{
return linux_proc_pid_to_exec_file (pid);
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;
/* 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". */
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;
gdb_byte *readbuf, const gdb_byte *writebuf,
ULONGEST offset, LONGEST len)
{
- char *file;
ULONGEST pid;
int total_len;
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;
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");
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 ();