From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23316 invoked by alias); 24 Jul 2014 13:24:07 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 23296 invoked by uid 89); 24 Jul 2014 13:24:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 24 Jul 2014 13:24:05 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6ODO3D7031638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Jul 2014 09:24:03 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6ODO0nb009028; Thu, 24 Jul 2014 09:24:01 -0400 Message-ID: <53D108F0.9060100@redhat.com> Date: Thu, 24 Jul 2014 13:25:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Gary Benson , gdb-patches@sourceware.org CC: Doug Evans , Tom Tromey Subject: Re: [PATCH 2/3 v4] Remove some GDBSERVER checks from linux-ptrace References: <1406206287-6817-1-git-send-email-gbenson@redhat.com> <1406206287-6817-3-git-send-email-gbenson@redhat.com> In-Reply-To: <1406206287-6817-3-git-send-email-gbenson@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-07/txt/msg00629.txt.bz2 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