From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18919 invoked by alias); 30 Dec 2009 20:14:30 -0000 Received: (qmail 18907 invoked by uid 22791); 30 Dec 2009 20:14:29 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from e24smtp05.br.ibm.com (HELO e24smtp05.br.ibm.com) (32.104.18.26) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 30 Dec 2009 20:14:24 +0000 Received: from mailhub1.br.ibm.com (mailhub1.br.ibm.com [9.18.232.109]) by e24smtp05.br.ibm.com (8.14.3/8.13.1) with ESMTP id nBUK583r020571 for ; Wed, 30 Dec 2009 18:05:08 -0200 Received: from d24av02.br.ibm.com (d24av02.br.ibm.com [9.8.31.93]) by mailhub1.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nBUKGIEj811296 for ; Wed, 30 Dec 2009 18:16:18 -0200 Received: from d24av02.br.ibm.com (loopback [127.0.0.1]) by d24av02.br.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nBUKELnY005322 for ; Wed, 30 Dec 2009 18:14:21 -0200 Received: from hactar.localnet ([9.8.6.18]) by d24av02.br.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id nBUKEKqs005317 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 30 Dec 2009 18:14:21 -0200 From: Thiago Jung Bauermann To: Joel Brobecker Subject: Re: [RFA] Fix hw watchpoint count in update_watchpoint Date: Wed, 30 Dec 2009 20:14:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.30-2-686; KDE/4.3.2; i686; ; ) Cc: gdb-patches@sourceware.org References: <200912301446.48771.bauerman@br.ibm.com> <20091230190626.GG2788@adacore.com> In-Reply-To: <20091230190626.GG2788@adacore.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_xR7OLV9FNlslvNH" Message-Id: <200912301813.37661.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/msg00451.txt.bz2 --Boundary-00=_xR7OLV9FNlslvNH Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-length: 1203 On Wed 30 Dec 2009 17:06:26 Joel Brobecker wrote: > > + /* Mark as software watchpoint to ensure that this watchpoint > > + will not be counted in the hw_watchpoint_used_count call > > + below. */ > > /* We need to determine how many resources are already used > for all other hardware watchpoints to see if we still have > enough resources to also fit this watchpoint in as well. > To avoid the hw_watchpoint_used_count call below from > counting this watchpoint, make sure that it is marked as a software > watchpoint. */ > > This is only a suggestion, so if you don't like it, please commit your > version, and I'll see if I can suggest an update separately. Your version is much better. I used it. > Thanks for submitting the patch! (and welcome back, it's been a while) Thanks! It's nice to be back. :-) I committed the attached. -- []'s Thiago Jung Bauermann IBM Linux Technology Center 20090-12-30 Jan Kratochvil Thiago Jung Bauermann * breakpoint.c (update_watchpoint): Change b->type to bp_watchpoint before calling hw_watchpoint_used_count. --Boundary-00=_xR7OLV9FNlslvNH Content-Type: text/x-patch; charset="UTF-8"; name="watchpoint-count-fix.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="watchpoint-count-fix.diff" Content-length: 874 Index: src/gdb/breakpoint.c =================================================================== --- src.orig/gdb/breakpoint.c 2009-12-30 15:41:58.000000000 -0200 +++ src/gdb/breakpoint.c 2009-12-30 18:04:57.000000000 -0200 @@ -1152,6 +1152,13 @@ update_watchpoint (struct breakpoint *b, { int i, mem_cnt, other_type_used; + /* We need to determine how many resources are already used + for all other hardware watchpoints to see if we still have + enough resources to also fit this watchpoint in as well. + To avoid the hw_watchpoint_used_count call below from counting + this watchpoint, make sure that it is marked as a software + watchpoint. */ + b->type = bp_watchpoint; i = hw_watchpoint_used_count (bp_hardware_watchpoint, &other_type_used); mem_cnt = can_use_hardware_watchpoint (val_chain); --Boundary-00=_xR7OLV9FNlslvNH--