From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7805 invoked by alias); 24 Nov 2010 21:06:09 -0000 Received: (qmail 7723 invoked by uid 22791); 24 Nov 2010 21:06:08 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e24smtp04.br.ibm.com (HELO e24smtp04.br.ibm.com) (32.104.18.25) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 24 Nov 2010 21:06:02 +0000 Received: from mailhub3.br.ibm.com (mailhub3.br.ibm.com [9.18.232.110]) by e24smtp04.br.ibm.com (8.14.4/8.13.1) with ESMTP id oAOKwVR0003459 for ; Wed, 24 Nov 2010 18:58:31 -0200 Received: from d24av04.br.ibm.com (d24av04.br.ibm.com [9.8.31.97]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oAOLCvQ52416876 for ; Wed, 24 Nov 2010 19:12:57 -0200 Received: from d24av04.br.ibm.com (loopback [127.0.0.1]) by d24av04.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oAOL5vZO025729 for ; Wed, 24 Nov 2010 19:05:58 -0200 Received: from [9.78.145.176] ([9.78.145.176]) by d24av04.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id oAOL5v2U025716; Wed, 24 Nov 2010 19:05:57 -0200 Subject: Re: [patch 2/3] Implement support for PowerPC BookE ranged watchpoints From: Thiago Jung Bauermann To: Pedro Alves Cc: gdb-patches@sourceware.org, Jan Kratochvil , Joel Brobecker , Eli Zaretskii In-Reply-To: <201011232316.56539.pedro@codesourcery.com> References: <1290549100.3164.47.camel@hactar> <201011232316.56539.pedro@codesourcery.com> Content-Type: text/plain; charset="UTF-8" Date: Wed, 24 Nov 2010 21:06:00 -0000 Message-ID: <1290632755.3164.94.camel@hactar> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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: 2010-11/txt/msg00410.txt.bz2 On Tue, 2010-11-23 at 23:16 +0000, Pedro Alves wrote: > On Tuesday 23 November 2010 21:51:40, Thiago Jung Bauermann wrote: > > Ok? > > Apologies for jumping in so late, but, I don't think I understand > why does the user need to know that a watchpoint is "ranged" > or not. All (low-level) watchpoints are ranged, Good point. At the time these patches were made, GDB didn't behave that way, but it was fixed one year ago already[1]. I guess I just kept the old mentality... > and what's > relevant here is only the width of the range the hardware can watch, > but that is already a parameter to the target_insert_watchpoint > method. So I guess my question is, why can't the target backend > manage whether to use a range or "normal" watchpoint when asked to > inserted a watchpoint? Is it the watch resource accounting done > by breakpoint.c (which is known to be something that should just > go away)? Yes, the resource accounting is an issue. But also, the target needs to know that it's being asked to watch a region which is expected to have accesses in the middle of it. This is because of the difference of how hardware watchpoints work in server and embedded PowerPC processors. In the former, a hardware watchpoint triggers when any byte within an 8 byte window starting at the given address is accessed. In the latter, only accesses at the given address trigger the watchpoint. So for an embedded powerpc processor, it's not enough to know that it should watch a 4 byte region at a given address. If it represents an integer and thus it can expect accesses only at that address then a regular watchpoint is enough. But if it's an array of four chars, then it needs two watchpoint registers to set up a hardware watchpoint... So that's way I created a target_insert_ranged_watchpoint. The other option would be to add a flag to target_insert_watchpoint... -- []'s Thiago Jung Bauermann IBM Linux Technology Center [1] - http://sourceware.org/ml/gdb-patches/2009-12/msg00368.html