From patchwork Thu Jun 19 16:56:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 1572 Received: (qmail 6168 invoked by alias); 19 Jun 2014 16:56:52 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 6155 invoked by uid 89); 19 Jun 2014 16:56: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, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD 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, 19 Jun 2014 16:56:51 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5JGumqi024134 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jun 2014 12:56:48 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5JGukQ2005432; Thu, 19 Jun 2014 12:56:47 -0400 Message-ID: <53A3164E.4020109@redhat.com> Date: Thu, 19 Jun 2014 17:56:46 +0100 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: Pedro Alves , Jan Kratochvil CC: Doug Evans , "gdb-patches@sourceware.org" Subject: Re: Regression for watchpoint-fork.exp [Re: [PATCH v3 2/5] PR breakpoints/7143 - Watchpoint does not trigger when first set] References: <1394154640-14053-1-git-send-email-palves@redhat.com> <1394154640-14053-3-git-send-email-palves@redhat.com> <53272CB0.6050101@redhat.com> <532AF3D0.8090904@redhat.com> <20140617191850.GA10997@host2.jankratochvil.net> <20140619134330.GA14567@host2.jankratochvil.net> <53A2FB68.9090500@redhat.com> In-Reply-To: <53A2FB68.9090500@redhat.com> On 06/19/2014 04:02 PM, Pedro Alves wrote: >> Attaching gzipped gdb.threads/watchpoint-fork-parent-st >> from gcc-4.9.0-9.fc21.x86_64. > > Thanks, I can reproduce it. Hmm, I suspect this might be related to kernel-side validation of DR_CONTROL vs DR0-3, like what we already handle in amd64_linux_prepare_to_resume. And indeed this below makes the error go away. Not exactly sure why yet. diff --git c/gdb/amd64-linux-nat.c w/gdb/amd64-linux-nat.c index 06199af..5972415 100644 --- c/gdb/amd64-linux-nat.c +++ w/gdb/amd64-linux-nat.c @@ -415,6 +415,8 @@ amd64_linux_prepare_to_resume (struct lwp_info *lwp) Ensure DR_CONTROL gets written as the very last register here. */ + amd64_linux_dr_set (lwp->ptid, DR_CONTROL, 0); + for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++) if (state->dr_ref_count[i] > 0) {