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 2/3 v4] Remove some GDBSERVER checks from linux-ptrace


>>>>> "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


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