This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] constify to_attach
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 21 May 2014 14:22:27 -0700
- Subject: Re: [PATCH] constify to_attach
- Authentication-results: sourceware.org; auth=none
- References: <1400696455-29563-1-git-send-email-tromey at redhat dot com> <87mwebhsc2 dot fsf at fleche dot redhat dot com>
> I also wanted to note that I checked all the functions for forward
> declarations as well.
>
> Tom
>
> 2014-05-21 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.
I tried a few different ways to see if we may have missed any other
files, and came up empty, so hopefully you nailed them all.
For this sort of search, it would be helpful to have a convention
that we either use var->method to set the field, or else put the name
of the field in comment next to the assignment like we do with
the language vector. That really makes it easier to find them;
otherwise, one has to use code analyzers, which sometimes don't
work when you can't compile the file first.
Patch looks good to me!
--
Joel