From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21706 invoked by alias); 16 Jun 2014 13:19:10 -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 21694 invoked by uid 89); 16 Jun 2014 13:19:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 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; Mon, 16 Jun 2014 13:19:08 +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 s5GDJ3Hn011857 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Jun 2014 09:19:03 -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 s5GDJ1ON015767; Mon, 16 Jun 2014 09:19:02 -0400 Message-ID: <539EEEC4.1080409@redhat.com> Date: Mon, 16 Jun 2014 13:19: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: "Breazeal, Don" , lgustavo@codesourcery.com, gdb-patches@sourceware.org Subject: Re: [PATCH] Fix for follow-fork: followed child doesn't stop References: <1401920383-10219-1-git-send-email-donb@codesourcery.com> <53906D28.5000404@codesourcery.com> <5390E4D1.2050108@codesourcery.com> <5391A73A.6000107@redhat.com> <539A4EB0.6020205@codesourcery.com> In-Reply-To: <539A4EB0.6020205@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-06/txt/msg00548.txt.bz2 On 06/13/2014 02:06 AM, Breazeal, Don wrote: > > Hi Pedro, > Thanks for clarifying this for me. Thanks for working on this. > > On 6/6/2014 4:34 AM, Pedro Alves wrote: > Set the cloned breakpoint as disabled from the moment it is created. > This is done by modifying clone_momentary_breakpoint to take an > additional argument, LOC_ENABLED, which is used as the value of the > bp_location->enabled member. The clone must be disabled at that point, > rather than later, because clone_momentary_breakpoint calls > update_global_location_list, which will treat the clone as a duplicate > of the original breakpoint if it is enabled. > > All the calls to clone_momentary_breakpoint had to be modified to pass > '1' or '0'. I looked at implementing an enum for the enabled member, > but concluded that readability would suffer because there are so many > places it is used as a boolean, e.g. "if (bl->enabled)". > > In follow_inferior_reset_breakpoints, the clone is set to enabled once > it has been associated with the child process. With this, the > bp_location 'inserted' member is maintained correctly throughout the > follow-fork procedure and the behavior is as expected. > > The same treatment is given to the exception_resume_breakpoint when > following a fork. > > Testing: > > Ran 'make check' on Linux x64. > > Along with the fix above, the coverage of the follow-fork test > gdb.base/foll-fork.exp was expanded to: > > 1) cover all the combinations of values for follow-fork-mode and > detach-on-fork > > 2) make sure that both user breakpoints and single-step breakpoints are > propagated correctly to the child > > 3) check that the inferior list has the expected contents after > following the fork. > > 4) check that unfollowed, undetached inferiors can be resumed. > Excellent. This version is OK. Thanks! -- Pedro Alves