From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32179 invoked by alias); 5 May 2011 11:04:42 -0000 Received: (qmail 32170 invoked by uid 22791); 5 May 2011 11:04:41 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate5.uk.ibm.com (HELO mtagate5.uk.ibm.com) (194.196.100.165) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 May 2011 11:04:25 +0000 Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate5.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p45B4OGo018795 for ; Thu, 5 May 2011 11:04:24 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p45B5aMI2298010 for ; Thu, 5 May 2011 12:05:36 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p45B4Njb001601 for ; Thu, 5 May 2011 05:04:23 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p45B4MjG001575; Thu, 5 May 2011 05:04:22 -0600 Message-Id: <201105051104.p45B4MjG001575@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Thu, 05 May 2011 13:04:22 +0200 Subject: Re: [RFA 2/3] Demote to sw watchpoint only in update_watchpoint To: bauerman@br.ibm.com (Thiago Jung Bauermann) Date: Thu, 05 May 2011 11:04:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org (gdb-patches ml) In-Reply-To: <1304398546.2245.80.camel@hactar> from "Thiago Jung Bauermann" at May 03, 2011 01:55:46 AM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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-05/txt/msg00123.txt.bz2 Thiago Jung Bauermann wrote: > On the other hand, the current code is already broken in that regard, > and creating several read and access watchpoints on today's GDB will > confuse it and allow creating more hardware watchpoints (read, access or > regular) than possible. Thus, this patch doesn't make the situation any > worse. So now I just use b->type. > > The real fix IMHO would be to make the -tdep code manage the creation > and deletion of bp_locations, so that it could always make an informed > decision about what can and cannot be done with the available hardware > debug resources. But that's out of the scope of this patch series. Yes, I'd agree with Eli and Pedro that this really ought to be fixed. I also agree that this is independent of this patch (and in fact I'd consider the patch a (small) step in the right direction anyway, since it reduced the number of locations in the code where resource accounting is done) ... > 2011-05-03 Thiago Jung Bauermann > > * breakpoint.c (update_watchpoint): Change between software and > hardware watchpoint for all kinds of watchpoints, not just > read/write ones. Determine b->exact value here instead of > in watch_command_1. Error out if there are not enough resources > for a read or access hardware watchpoint. > (watch_command_1): Remove logic of checking whether there are > enough resources available, since update_watchpoint will do that > work now. Don't set b->exact here. Catch exceptions thrown by > update_watchpoint and delete the watchpoint. > (can_use_hardware_watchpoint): Remove exact_watchpoints argument. > Use target_exact_watchpoints instead. > (delete_breakpoint): Notify observers only if deleted watchpoint > has a breakpoint number assigned to it. As Eli has withdrawn objections to the patch, this is OK. Thanks, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com