From c0939df1ce443e82c44188ff988acbb45780bfd7 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 15 Apr 2013 09:40:57 -0600 Subject: 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 * 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) : Make "args" const. (find_default_attach): Likewise. * utils.c (parse_pid_to_attach): Make "args" const. * utils.h (parse_pid_to_attach): Update. --- gdb/remote.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gdb/remote.c') diff --git a/gdb/remote.c b/gdb/remote.c index 6774d84..8f9478c 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -4365,7 +4365,8 @@ remote_disconnect (struct target_ops *target, char *args, int from_tty) be chatty about it. */ static void -extended_remote_attach_1 (struct target_ops *target, char *args, int from_tty) +extended_remote_attach_1 (struct target_ops *target, const char *args, + int from_tty) { struct remote_state *rs = get_remote_state (); int pid; @@ -4478,7 +4479,7 @@ extended_remote_attach_1 (struct target_ops *target, char *args, int from_tty) } static void -extended_remote_attach (struct target_ops *ops, char *args, int from_tty) +extended_remote_attach (struct target_ops *ops, const char *args, int from_tty) { extended_remote_attach_1 (ops, args, from_tty); } -- cgit v1.1