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: Tom Tromey <tromey at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Gary Benson <gbenson at redhat dot com>, gdb-patches at sourceware dot org, Doug Evans <dje at google dot com>
- Date: Thu, 24 Jul 2014 08:07:03 -0600
- 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> <53D108F0 dot 9060100 at redhat dot com>
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>> + current_ptrace_options |= PTRACE_O_TRACECLONE |
>> + (additional_flags & ~(PTRACE_O_TRACESYSGOOD
>> + | PTRACE_O_TRACEVFORKDONE));
Pedro> This isn't right. That enables e.g., PTRACE_O_TRACEEXIT, for example,
Pedro> and possibly invalid flags even.
I don't see how that can happen. I think the "&" prevents it.
Pedro> Please reverse that and spell out the flags we want here
Pedro> explicitly, like:
Pedro> current_ptrace_options |= PTRACE_O_TRACECLONE;
Pedro> current_ptrace_options |= (additional_flags & (PTRACE_O_TRACEFORK
Pedro> | PTRACE_O_TRACEVFORK
Pedro> | PTRACE_O_TRACEEXEC));
Though FWIW this does seem clearer.
Tom