From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18010 invoked by alias); 30 Dec 2009 03:23:35 -0000 Received: (qmail 18002 invoked by uid 22791); 30 Dec 2009 03:23:34 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from e24smtp03.br.ibm.com (HELO e24smtp03.br.ibm.com) (32.104.18.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 30 Dec 2009 03:23:00 +0000 Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by e24smtp03.br.ibm.com (8.14.3/8.13.1) with ESMTP id nBU3LY56029045 for ; Wed, 30 Dec 2009 01:21:35 -0200 Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.8.31.91]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nBU3MvU83838118 for ; Wed, 30 Dec 2009 00:22:57 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nBU3Mv8a032526 for ; Wed, 30 Dec 2009 01:22:57 -0200 Received: from hactar.localnet ([9.18.196.37]) by d24av01.br.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id nBU3Mu0f032507 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 30 Dec 2009 01:22:57 -0200 From: Thiago Jung Bauermann To: Jan Kratochvil Subject: Re: [PATCH 2/4] Hardware accelerated watchpoint conditions Date: Wed, 30 Dec 2009 03:23:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.30-2-686; KDE/4.3.2; i686; ; ) Cc: gdb-patches@sourceware.org, Luis Machado , Matt Tyrlik References: <200912232231.01798.bauerman@br.ibm.com> <20091224184056.GA8545@host0.dyn.jankratochvil.net> In-Reply-To: <20091224184056.GA8545@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912300122.12978.bauerman@br.ibm.com> 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: 2009-12/txt/msg00426.txt.bz2 On Thu 24 Dec 2009 16:40:56 Jan Kratochvil wrote: > > --- gdb.orig/gdb/breakpoint.c 2009-12-23 15:14:03.000000000 -0200 > > +++ gdb/gdb/breakpoint.c 2009-12-23 17:07:34.000000000 -0200 > > @@ -1151,6 +1151,13 @@ update_watchpoint (struct breakpoint *b, > > + enum enable_state e; > > + > > + /* We have to temporary disable this watchpoint, otherwise > > + we will count it twice (once as being inserted, and once > > + as a watchpoint that we want to insert). */ > > + e = b->enable_state; > > + b->enable_state = bp_disabled; > > > > i = hw_watchpoint_used_count (bp_hardware_watchpoint, > > &other_type_used); > > @@ -1167,6 +1174,8 @@ update_watchpoint (struct breakpoint *b, > > else > > b->type = bp_hardware_watchpoint; > > } > > + /* Restoring the original state. */ > > + b->enable_state = e; > > } > > > > frame_pspace = get_frame_program_space (get_selected_frame > > (NULL)); > > Isn't it enough to just reset it before calling hw_watchpoint_used_count > by: b->type = bp_watchpoint; > > (It is safer wrt hypothetical error() in the meantime.) > > Had such local patch for ppc (this is a code by me but it was a regression, > it was broken before and my fix was just incomplete). Indeed, that worked too and looks cleaner. I'll post this fix as a separate patch, since it is a bug that affects GDB's counting of hardware watchpoint resources regardless of the features we are introducing here. Thanks! -- []'s Thiago Jung Bauermann IBM Linux Technology Center