From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11616 invoked by alias); 19 Jun 2014 17:00:38 -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 11606 invoked by uid 89); 19 Jun 2014 17:00:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 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 17:00:36 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5JH0XRM031338 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jun 2014 13:00:33 -0400 Received: from host2.jankratochvil.net (ovpn-116-53.ams2.redhat.com [10.36.116.53]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5JH0T4P031428 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Thu, 19 Jun 2014 13:00:32 -0400 Date: Thu, 19 Jun 2014 17:00:00 -0000 From: Jan Kratochvil To: Pedro Alves 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] Message-ID: <20140619170029.GA31275@host2.jankratochvil.net> 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> <53A3164E.4020109@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53A3164E.4020109@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00711.txt.bz2 On Thu, 19 Jun 2014 18:56:46 +0200, Pedro Alves wrote: > 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. Because there is a data watchpoint of size 4 bytes at that DRx slot and it is being updated by that 'hbreak' unaligned watchpoint (after the data watchpoint is no longer valid). But DR_CONTROL is updated only afterwards. Your patch seems to be right. Thanks, Jan > > 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) > { > > -- > Pedro Alves