From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19868 invoked by alias); 13 Dec 2011 21:38:14 -0000 Received: (qmail 19859 invoked by uid 22791); 13 Dec 2011 21:38:14 -0000 X-SWARE-Spam-Status: No, hits=-7.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Dec 2011 21:37:51 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pBDLbldB009708 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 13 Dec 2011 16:37:48 -0500 Received: from host2.jankratochvil.net (ovpn-116-16.ams2.redhat.com [10.36.116.16]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pBDLbh7c030069 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 13 Dec 2011 16:37:46 -0500 Date: Tue, 13 Dec 2011 22:27:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] PR threads/10729: x86 hw watchpoints and non-stop mode Message-ID: <20111213213743.GA10804@host2.jankratochvil.net> References: <201112051601.59664.pedro@codesourcery.com> <201112122030.25365.pedro@codesourcery.com> <20111212203409.GA28419@host2.jankratochvil.net> <201112131626.03262.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201112131626.03262.pedro@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 X-SW-Source: 2011-12/txt/msg00430.txt.bz2 On Tue, 13 Dec 2011 17:26:03 +0100, Pedro Alves wrote: > +amd64_linux_prepare_to_resume (struct lwp_info *lwp) > { > - struct lwp_info *lp; > + int clear_status = 0; > > - ALL_LWPS (lp) > + if (lwp->arch_private->debug_registers_changed) > { > - unsigned long value; > - > - value = amd64_linux_dr_get (lp->ptid, DR_STATUS); > - value &= ~mask; > - amd64_linux_dr_set (lp->ptid, DR_STATUS, value); > + struct i386_debug_reg_state *state = i386_debug_reg_state (); > + int i; > + > + for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++) > + if (state->dr_ref_count[i] > 0) > + { > + amd64_linux_dr_set (lwp->ptid, i, state->dr_mirror[i]); FYI this way it will leave non-zero DR_FIRSTADDR...DR_LASTADDR after detaching from the inferior. This is not a bug, just that it may look as a sort of regression. I do not think a fix - clearing them - is required. Thanks, Jan