Constify target_pid_to_exec_file

This changes target_pid_to_exec_file and target_ops::pid_to_exec_file
to return a "const char *".  I couldn't build many of these targets,
but did examine the code by hand -- also, as this only affects the
return type, it's normally pretty safe.  This brings gdb and gdbserver
a bit closer, and allows for the removal of a const_cast as well.
This commit is contained in:
Tom Tromey 2022-04-26 14:08:03 -06:00
parent f1025b233f
commit 0e90c44162
20 changed files with 32 additions and 32 deletions

View file

@ -127,7 +127,7 @@ public:
std::string pid_to_str (ptid_t) override;
char *pid_to_exec_file (int pid) override;
const char *pid_to_exec_file (int pid) override;
thread_control_capabilities get_thread_control_capabilities () override
{ return tc_schedlock; }
@ -2927,7 +2927,7 @@ procfs_target::pid_to_str (ptid_t ptid)
/* Accepts an integer PID; Returns a string representing a file that
can be opened to get the symbols for the child process. */
char *
const char *
procfs_target::pid_to_exec_file (int pid)
{
static char buf[PATH_MAX];