aboutsummaryrefslogtreecommitdiff
path: root/gdb/procfs.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-04-15 09:40:57 -0600
committerTom Tromey <tromey@redhat.com>2014-06-04 11:11:43 -0600
commitc0939df1ce443e82c44188ff988acbb45780bfd7 (patch)
tree7d847e02170ab27d7e9eb7f4a3f406c5a7af5fd1 /gdb/procfs.c
parent8eaff7cd138d8517f8c2fbc8be9b8c6eaf649bd9 (diff)
downloadgdb-c0939df1ce443e82c44188ff988acbb45780bfd7.zip
gdb-c0939df1ce443e82c44188ff988acbb45780bfd7.tar.gz
gdb-c0939df1ce443e82c44188ff988acbb45780bfd7.tar.bz2
constify to_attach
This constifies the "args" argument to the target_ops to_attach method. I updated all instances of the method. I could not compile all of them but I hand-inspected them. In all cases either the argument is ignored, or it is passed to parse_pid_to_attach. (linux-nat does some extra stuff, but that one I built...) If you want to try it on your host of choice, please do so. The code in parse_pid_to_attach seems a little bogus to me. If there is a platform with a broken strtoul, we have better methods for fixing the issue now. However, I left the code as is since it is clearly ok to do so. Built and regtested on x86-64 Fedora 20. 2014-06-04 Tom Tromey <tromey@redhat.com> * procfs.c (procfs_attach): Make "args" const. * windows-nat.c (windows_attach): Make "args" const. * nto-procfs.c (procfs_attach): Make "args" const. * inf-ttrace.c (inf_ttrace_attach): Make "args" const. * go32-nat.c (go32_attach): Make "args" const. * gnu-nat.c (gnu_attach): Make "args" const. * darwin-nat.c (darwin_attach): Make "args" const. * inf-ptrace.c (inf_ptrace_attach): Make "args" const. * linux-nat.c (linux_nat_attach): Make "args" const. * remote.c (extended_remote_attach_1, extended_remote_attach): Make "args" const. * target.h (struct target_ops) <to_attach>: Make "args" const. (find_default_attach): Likewise. * utils.c (parse_pid_to_attach): Make "args" const. * utils.h (parse_pid_to_attach): Update.
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r--gdb/procfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c
index cd3301a..6a2aef8 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -110,7 +110,7 @@
/* This module defines the GDB target vector and its methods. */
-static void procfs_attach (struct target_ops *, char *, int);
+static void procfs_attach (struct target_ops *, const char *, int);
static void procfs_detach (struct target_ops *, const char *, int);
static void procfs_resume (struct target_ops *,
ptid_t, int, enum gdb_signal);
@@ -3039,7 +3039,7 @@ procfs_debug_inferior (procinfo *pi)
}
static void
-procfs_attach (struct target_ops *ops, char *args, int from_tty)
+procfs_attach (struct target_ops *ops, const char *args, int from_tty)
{
char *exec_file;
int pid;