From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11858 invoked by alias); 2 Oct 2013 22:08:31 -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 11844 invoked by uid 89); 2 Oct 2013 22:08:30 -0000 Received: from mailrelay012.isp.belgacom.be (HELO mailrelay012.isp.belgacom.be) (195.238.6.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 02 Oct 2013 22:08:30 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.1 required=5.0 tests=AWL,BAYES_00,CK_HELO_DYNAMIC_SPLIT_IP,HELO_DYNAMIC_SPLIT_IP,SPF_SOFTFAIL,TVD_RCVD_IP autolearn=no version=3.3.2 X-HELO: mailrelay012.isp.belgacom.be X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApMBAC6YTFJtgNJg/2dsb2JhbAANTIc5uxeCe4EwgxkBAQEEI1YQCw4KAgIfBwICVwayenWSMoEpjXUzB4JqgTkDoj2JKYFA Received: from 96.210-128-109.adsl-dyn.isp.belgacom.be (HELO [192.168.1.5]) ([109.128.210.96]) by relay.skynet.be with ESMTP; 03 Oct 2013 00:08:25 +0200 Subject: Re: Always run the PTRACE_O_TRACESYSGOOD tests even if PTRACE_O_TRACEFORK is not supported. (was: Re: RFA [PATCH v4] Implement 'catch syscall' for gdbserver) From: Philippe Waroquiers To: Pedro Alves Cc: Sergio Durigan Junior , gdb-patches@sourceware.org In-Reply-To: <524C76D4.1010301@redhat.com> References: <1379796907.5980.20.camel@soleil> <1380467062.3567.52.camel@soleil> <524C76D4.1010301@redhat.com> Content-Type: text/plain; charset="UTF-8" Date: Wed, 02 Oct 2013 22:08:00 -0000 Message-ID: <1380751722.2227.37.camel@soleil> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00111.txt.bz2 On Wed, 2013-10-02 at 20:41 +0100, Pedro Alves wrote: > On 09/29/2013 04:04 PM, Philippe Waroquiers wrote: > > > Index: common/linux-ptrace.c > > =================================================================== > > RCS file: /cvs/src/src/gdb/common/linux-ptrace.c,v > > retrieving revision 1.12 > > diff -u -p -r1.12 linux-ptrace.c > > --- common/linux-ptrace.c 28 Aug 2013 14:09:31 -0000 1.12 > > +++ common/linux-ptrace.c 29 Sep 2013 14:20:29 -0000 > > @@ -361,16 +361,18 @@ linux_check_ptrace_features (void) > > return; > > } > > > > -#ifdef GDBSERVER > > - /* gdbserver does not support PTRACE_O_TRACESYSGOOD or > > - PTRACE_O_TRACEVFORKDONE yet. */ > > -#else > > - /* Check if the target supports PTRACE_O_TRACESYSGOOD. */ > > + /* Check if the target supports PTRACE_O_TRACESYSGOOD. > > + We keep PTRACE_O_TRACEFORK option activated as a fork > > + event notification is expected after my_waitpid below. */ > > ret = ptrace (PTRACE_SETOPTIONS, child_pid, (PTRACE_TYPE_ARG3) 0, > > - (PTRACE_TYPE_ARG4) PTRACE_O_TRACESYSGOOD); > > + (PTRACE_TYPE_ARG4) (PTRACE_O_TRACEFORK > > + | PTRACE_O_TRACESYSGOOD)); > > This coupling looks unfortunate. Actually why wasn't this a > problem for the native target, even without GDBserver in the picture? > It just looks like a bug fix? Yes I think there is already a similar coupling problem in the native code: if PTRACE_O_TRACESYSGOOD is supported but PTRACE_O_TRACEVFORKDONE is not, then the PTRACE_O_TRACESYSGOOD verification has removed the flag PTRACE_O_TRACEFORK and so the following my_waitpid will fail. The patch you give looks to solve all that. Philippe