From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28350 invoked by alias); 18 Dec 2009 10:19:55 -0000 Received: (qmail 28342 invoked by uid 22791); 18 Dec 2009 10:19:54 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout21.012.net.il (HELO mtaout21.012.net.il) (80.179.55.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Dec 2009 10:19:49 +0000 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0KUU00100F4ST300@a-mtaout21.012.net.il> for gdb-patches@sourceware.org; Fri, 18 Dec 2009 12:19:41 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.70.160.137]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KUU000DYFCS30A0@a-mtaout21.012.net.il>; Fri, 18 Dec 2009 12:19:41 +0200 (IST) Date: Fri, 18 Dec 2009 10:19:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH 0/2] Support the new PPC476 processor In-reply-to: <200912161847.17162.sergiodj@linux.vnet.ibm.com> To: =?iso-8859-1?q?S=E9rgio_Durigan_J=FAnior?= Cc: gdb-patches@sourceware.org, bauerman@br.ibm.com, luisgpm@linux.vnet.ibm.com, tyrlik@us.ibm.com Reply-to: Eli Zaretskii Message-id: <83y6l060qp.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 8BIT References: <200912161847.17162.sergiodj@linux.vnet.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/msg00246.txt.bz2 > From: Sérgio_Durigan_Júnior > Date: Wed, 16 Dec 2009 18:47:16 -0200 > Cc: Thiago Jung Bauermann , Luis Machado , Matt Tyrlik > > This series of patches implement the support for the new PowerPC 476 IBM > processor. This is an embedded processor with some nice debugging > capabilities, and I believe you will like to see the new types of > breakpoints/watchpoints implemented on GDB. Thanks! I have a few preliminary comments and questions about the proposed UI: > * Simple Hardware Watchpoints: Monitors accesses to a single data address. > For the PPC476, 2 of them are available provided that no Range/Mask > watchpoints are being used. There is also the possibility of using conditions > when monitoring the values. In this case, GDB will place the condition inside > a register, and the evaluation will be hardware-accelerated, which will speed- > up significantly the debugging process. The PPC476 processor has two > registers that can be used to hardware-accelerate the condition evaluation. > > - Available GDB commands: [r|a]watch (rwatch/awatch/watch) or > [r|a]watch if == <4-bytes unsigned constant> > > - Usage example: awatch i / rwatch *0xbffff8e8 / watch i if i == 28 Will GDB decide automatically whether to use hardware-accelerated conditions or the current implementation, whereby an unconditional hardware watchpoint is set, and when it breaks, GDB itself evaluates the condition? I think this should be done automatically. > * Range Hardware Watchpoints: Monitors accesses to an interval of data > addresses. For the 476, a single Range Hardware Watchpoint can be used > provided that no Simple/Mask watchpoints are being used. > > - Available GDB commands: [r|a]watch-range : length>>, where <= (rwatch-range/awatch-range/watch- > range) > > - Usage example: watch-range &i,&k / awatch-range 0xbffff8e8,0xbffff8f8 / > rwatch-range 0xbffff8e8,+8 Why is there a need for a separate GDB command? What are the use-cases where the user would want to watch a region that is spanned by more than one (albeit large) variable? If such use-cases are infrequent enough or obscure, then we could simply use the normal watch commands, and support any corner use-cases with something like watch *0xbffff8e8@8 using what is a normal GDB semantics for artificial arrays. IOW, no need for either the comma-separated list of 2 addresses or a separate command. > * Mask Hardware Watchpoints: Monitors accesses to data addresses that match > a specific pattern. For the 476, a single Mask Hardware Watchpoint can be > used provided that no Simple/Range watchpoints are being used. Due to the > processor's design, the precise data address of the watchpoint trigger is not > available, so the user must check the instruction that caused the trigger > (usually at PC - 4) to obtain such data address. With such data address in > hand, it's possible to tell if its contents have changed. > > - Available GDB commands: [r|a]watch mask > > > - Usage example: watch i mask 0xffffff00 / awatch *0xbffff8e8 mask > 0xffffff00 I'm not sure about the semantics of this: what exactly does the mask do? how does it modify the unmasked command for the same address? > * Range Hardware Breakpoint: Monitors an interval of instruction addresses. > > - Available GDB commands: hbreak-range : int length>> where <= / hbreak-range start>: > > - Usage example: hbreak-range 0x10000658,0x10000660 / hbreak-range > 0x10000658,+8 / hbreak-range 20,30 Again, what are the use-cases where such breakpoints would be useful?