aboutsummaryrefslogtreecommitdiff
path: root/gdb/nat
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-04-26 14:08:03 -0600
committerTom Tromey <tromey@adacore.com>2022-05-13 08:21:16 -0600
commit0e90c441629bcf1f53ba484f7d855ed8eb68f138 (patch)
tree32543d4e42dfa1873b0fca3e3a81c0e33cd67702 /gdb/nat
parentf1025b233f6dad43981f5ad35c81481f8d3658bf (diff)
downloadgdb-0e90c441629bcf1f53ba484f7d855ed8eb68f138.zip
gdb-0e90c441629bcf1f53ba484f7d855ed8eb68f138.tar.gz
gdb-0e90c441629bcf1f53ba484f7d855ed8eb68f138.tar.bz2
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.
Diffstat (limited to 'gdb/nat')
-rw-r--r--gdb/nat/linux-procfs.c2
-rw-r--r--gdb/nat/linux-procfs.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/gdb/nat/linux-procfs.c b/gdb/nat/linux-procfs.c
index 2618c99..99e6457 100644
--- a/gdb/nat/linux-procfs.c
+++ b/gdb/nat/linux-procfs.c
@@ -341,7 +341,7 @@ linux_proc_task_list_dir_exists (pid_t pid)
/* See linux-procfs.h. */
-char *
+const char *
linux_proc_pid_to_exec_file (int pid)
{
static char buf[PATH_MAX];
diff --git a/gdb/nat/linux-procfs.h b/gdb/nat/linux-procfs.h
index fa1280a..fcc8280 100644
--- a/gdb/nat/linux-procfs.h
+++ b/gdb/nat/linux-procfs.h
@@ -78,7 +78,7 @@ extern int linux_proc_task_list_dir_exists (pid_t pid);
to create the process PID. The returned value persists until this
function is next called. */
-extern char *linux_proc_pid_to_exec_file (int pid);
+extern const char *linux_proc_pid_to_exec_file (int pid);
/* Display possible problems on this system. Display them only once
per GDB execution. */