This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 02/15 v2] Remove some GDBSERVER checks from linux-ptrace


On Wed, Jul 16, 2014 at 7:17 AM, Gary Benson <gbenson@redhat.com> wrote:
> This patch removes some GDBSERVER checks from nat/linux-ptrace.c.
> Currently the code uses a compile-time check to decide whether some
> flags should be used.  This changes the code to instead let users of
> the module specify an additional set of flags; and then changes gdb's
> linux-nat.c to call this function.  At some later date, when the back
> ends are fully merged, we will be able to remove this function again.
>
> gdb/
> 2014-07-16  Tom Tromey  <tromey@redhat.com>
>             Gary Benson  <gbenson@redhat.com>
>
>         * nat/linux-ptrace.c (additional_flags): New global.
>         (linux_test_for_tracesysgood, linux_test_for_tracefork): Use
>         additional_flags; don't check GDBSERVER.
>         (linux_ptrace_set_additional_flags): New function.
>         * nat/linux-ptrace.h (linux_ptrace_set_additional_flags):
>         Declare.
>         * linux-nat.c (_initialize_linux_nat): Call
>         linux_ptrace_set_additional_flags.

LGTM.

I had a thought, and please don't feel compelled to have to submit yet
another revision.
I'm just writing this down for completeness' sake.
Since linux_ptrace_set_additional_flags is supposed to be called
before any other related function, one could add an assert to the
other functions to verify this.

> [...]
> +/* Set additional ptrace flags to use.  Some such flags may be checked
> +   by the implementation above.  This function must be called before
> +   any other function in this file; otherwise the flags may not take
> +   effect appropriately.  */
> +
> +void
> +linux_ptrace_set_additional_flags (int flags)
> +{
> +  additional_flags = flags;
> +}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]