From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30818 invoked by alias); 24 Dec 2009 18:41:22 -0000 Received: (qmail 30809 invoked by uid 22791); 24 Dec 2009 18:41:22 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_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; Thu, 24 Dec 2009 18:41:17 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBOIf2Tn014612 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 24 Dec 2009 13:41:03 -0500 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBOIexrg007473 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Dec 2009 13:41:02 -0500 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id nBOIexPs008701; Thu, 24 Dec 2009 19:40:59 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id nBOIeuHr008698; Thu, 24 Dec 2009 19:40:56 +0100 Date: Thu, 24 Dec 2009 18:41:00 -0000 From: Jan Kratochvil To: Thiago Jung Bauermann Cc: gdb-patches@sourceware.org, Luis Machado , Matt Tyrlik Subject: Re: [PATCH 2/4] Hardware accelerated watchpoint conditions Message-ID: <20091224184056.GA8545@host0.dyn.jankratochvil.net> References: <200912232231.01798.bauerman@br.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912232231.01798.bauerman@br.ibm.com> User-Agent: Mutt/1.5.20 (2009-08-17) 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/msg00388.txt.bz2 > --- 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). Regards, Jan