This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/3 v4] Remove some GDBSERVER checks from linux-ptrace
- From: Pedro Alves <palves at redhat dot com>
- To: Gary Benson <gbenson at redhat dot com>, gdb-patches at sourceware dot org
- Cc: Doug Evans <dje at google dot com>, Tom Tromey <tromey at redhat dot com>
- Date: Thu, 24 Jul 2014 14:24:00 +0100
- Subject: Re: [PATCH 2/3 v4] Remove some GDBSERVER checks from linux-ptrace
- Authentication-results: sourceware.org; auth=none
- References: <1406206287-6817-1-git-send-email-gbenson at redhat dot com> <1406206287-6817-3-git-send-email-gbenson at redhat dot com>
On 07/24/2014 01:51 PM, Gary Benson wrote:
> /* 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;
> -#else
> - 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. */
> -#endif
> + current_ptrace_options |= PTRACE_O_TRACECLONE |
> + (additional_flags & ~(PTRACE_O_TRACESYSGOOD
> + | PTRACE_O_TRACEVFORKDONE));
This isn't right. That enables e.g., PTRACE_O_TRACEEXIT, for example,
and possibly invalid flags even.
Please reverse that and spell out the flags we want here explicitly, like:
current_ptrace_options |= PTRACE_O_TRACECLONE;
current_ptrace_options |= (additional_flags & (PTRACE_O_TRACEFORK
| PTRACE_O_TRACEVFORK
| PTRACE_O_TRACEEXEC));
Thanks,
Pedro Alves