From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24597 invoked by alias); 5 Jun 2014 08:43:28 -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 24583 invoked by uid 89); 5 Jun 2014 08:43:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 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 ESMTP; Thu, 05 Jun 2014 08:43:26 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s558hO8C018235 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 5 Jun 2014 04:43:24 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s558hM3E011605; Thu, 5 Jun 2014 04:43:23 -0400 Message-ID: <53902DAA.4090602@redhat.com> Date: Thu, 05 Jun 2014 08:43:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Hui Zhu , 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> In-Reply-To: <539020AB.8050105@mentor.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-06/txt/msg00237.txt.bz2 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. > + 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)); OK with that change. -- Pedro Alves