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


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


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