This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH 02/15] Remove some GDBSERVER checks from linux-ptrace
- From: Doug Evans <dje at google dot com>
- To: Gary Benson <gbenson at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 11 Jul 2014 12:28:57 -0700
- Subject: Re: [PATCH 02/15] Remove some GDBSERVER checks from linux-ptrace
- Authentication-results: sourceware.org; auth=none
- References: <1404902255-11101-1-git-send-email-gbenson at redhat dot com> <1404902255-11101-3-git-send-email-gbenson at redhat dot com>
Gary Benson writes:
> 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.
> 2014-07-09 Tom Tromey <firstname.lastname@example.org>
> Gary Benson <email@example.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):
> * linux-nat.c (_initialize_linux_nat): Call
Hi. Recognizing that this is a temporary hack, the patch is ok with me.
One nit below.
> @@ -433,18 +435,7 @@ linux_test_for_tracefork (int child_pid)
> /* We got the PID from the grandchild, which means fork
> tracing is supported. */
> -#ifdef GDBSERVER
> - /* Do not enable all the options for now since gdbserver does not
> - properly support them. This restriction will be lifted when
> - gdbserver is augmented to support them. */
> - current_ptrace_options |= PTRACE_O_TRACECLONE;
> - current_ptrace_options |= PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORK
> - | PTRACE_O_TRACECLONE | PTRACE_O_TRACEEXEC;
> - /* Do not enable PTRACE_O_TRACEEXIT until GDB is more prepared to
> - support read-only process state. */
> + current_ptrace_options |= PTRACE_O_TRACECLONE | additional_flags;
> /* Do some cleanup and kill the grandchild. */
> my_waitpid (second_pid, &second_status, 0);
I can't tell if the PTRACE_O_TRACEEXIT comment was accidentally
or intentionally dropped.
I'm not sure it's important enough to keep, but it would be
good to verify its deletion was intentional.