From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22873 invoked by alias); 12 Dec 2011 17:23:24 -0000 Received: (qmail 22865 invoked by uid 22791); 12 Dec 2011 17:23:23 -0000 X-SWARE-Spam-Status: No, hits=-7.7 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; Mon, 12 Dec 2011 17:23:10 +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 pBCHMie2021910 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 12 Dec 2011 12:22:44 -0500 Received: from host2.jankratochvil.net (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pBCHMdoI000471 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 12 Dec 2011 12:22:42 -0500 Date: Mon, 12 Dec 2011 18:38:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: Tristan Gingold , gdb-patches@sourceware.org Subject: Re: [PATCH] PR threads/10729: x86 hw watchpoints and non-stop mode Message-ID: <20111212172238.GA7737@host2.jankratochvil.net> References: <201112051601.59664.pedro@codesourcery.com> <201112091630.20916.pedro@codesourcery.com> <20111211233811.GA27629@host2.jankratochvil.net> <201112121656.44478.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201112121656.44478.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/msg00351.txt.bz2 On Mon, 12 Dec 2011 17:56:44 +0100, Pedro Alves wrote: > I'm trying out this patch: That's great, thanks. > > Deleting this part is a regression. Testcase for that part is attached. I will yet update the testcase to support gdbserver. > > > + && I386_DR_GET_RW_LEN (control, i) != 0) > > > { > > > - addr = state->dr_mirror[i]; > > > + addr = i386_dr_low.get_addr (i); > > > > Why to do this change? Why we can no longer trust DR_MIRROR? This is > > a performance regression. > > This is non-stop, so threads can be running while we change the > global state->dr_mirror (and friends). Say, we set a watchpoint, > and let the threads rusume. Now, say you delete the watchpoint, or > add/remove watchpoints such that state->dr_mirror[*] changes. Inserting/deleting > watchpoines updates state->dr_mirror[*]. Now threads haven't been updated > with the mirror yet, and say a thread has meanwhile hit an old watchpoint, > but we haven't handled the SIGTRAP yet. If we trusted state->dr_mirror[*], > we'd mistake the real trapped address to whatever was > currently state->dr_mirror[i]. So state->dr_mirror now represents > intention. To get at the address that trapped, we need to read the > state the thread had when it trapped. I'll add some comments to the code. Thanks for the explanation, yes, comment would be great. As there is a state for each inferior in the multi-inferior patch of mine it may be useful to change it to be per-TID so these ptrace reads can be avoided. Thanks, Jan