From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27329 invoked by alias); 8 Jun 2014 11:16:52 -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 27315 invoked by uid 89); 8 Jun 2014 11:16:51 -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 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 08 Jun 2014 11:16:50 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Wtb5i-0006Tl-6q from Hui_Zhu@mentor.com ; Sun, 08 Jun 2014 04:16:46 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sun, 8 Jun 2014 04:16:46 -0700 Received: from localhost.localdomain (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Sun, 8 Jun 2014 04:16:42 -0700 Message-ID: <5394460F.7060201@mentor.com> Date: Sun, 08 Jun 2014 11:16:00 -0000 From: Hui Zhu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Pedro Alves , gdb-patches ml Subject: Re: [PATCH] Fix gdb.base/watch-vfork.exp: Watchpoint triggers after vfork (sw) (timeout) with Linux 2.6.32 and older version References: <533D17E2.9070402@mentor.com> <538636AF.9040208@redhat.com> <539020AB.8050105@mentor.com> <53902DAA.4090602@redhat.com> In-Reply-To: <53902DAA.4090602@redhat.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00348.txt.bz2 On 06/05/14 16:43, Pedro Alves wrote: > On 06/05/2014 08:47 AM, Hui Zhu wrote: > >> >> 2014-06-05 Hui Zhu >> >> * common/linux-ptrace.c (linux_disable_event_reporting): New. >> * common/linux-ptrace.h (linux_disable_event_reporting): New extern. > > You're not adding an extern to an existing function, but adding new declaration > that happens to declare a function with extern linkage. > >> * linux-nat.c (linux_child_follow_fork): do a single step before >> detach > > Capitalization, and full stop both missing. Write instead: > > * common/linux-ptrace.c (linux_disable_event_reporting): New function. > * common/linux-ptrace.h (linux_disable_event_reporting): New declaration. > * linux-nat.c (linux_child_follow_fork): Do a single step before > detach. Updated. > >> + if (ptrace (PTRACE_SINGLESTEP, child_pid, 0, 0) < 0) >> + perror_with_name (_("Couldn't do single step")); >> + if (my_waitpid (child_pid, &status, 0) < 0) >> + perror_with_name (_("Couldn't wait vfork process")); >> + } >> + >> + ptrace (PTRACE_DETACH, child_pid, 0, WSTOPSIG (status)); > > The child could have exited with that single-step. So: > > if (WIFSTOPPED (status)) > ptrace (PTRACE_DETACH, child_pid, 0, WSTOPSIG (status)); Updated. > > OK with that change. > Thanks for your help. Committed as https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c077881afaedb9b74063bee992b3e472b4b6e9ca Best, Hui