From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26623 invoked by alias); 16 Dec 2009 20:48:49 -0000 Received: (qmail 26613 invoked by uid 22791); 16 Dec 2009 20:48:48 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from e33.co.us.ibm.com (HELO e33.co.us.ibm.com) (32.97.110.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Dec 2009 20:47:38 +0000 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e33.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id nBGKibuQ004317 for ; Wed, 16 Dec 2009 13:44:37 -0700 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id nBGKlRt5168192 for ; Wed, 16 Dec 2009 13:47:27 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nBGKlNS0013140 for ; Wed, 16 Dec 2009 13:47:24 -0700 Received: from miki.localnet ([9.8.13.48]) by d03av01.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id nBGKlJwp012799 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Dec 2009 13:47:23 -0700 From: =?iso-8859-1?q?S=E9rgio_Durigan_J=FAnior?= To: gdb-patches@sourceware.org Subject: [PATCH 0/2] Support the new PPC476 processor Date: Wed, 16 Dec 2009 20:48:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.30.4; KDE/4.3.2; i686; ; ) Cc: Thiago Jung Bauermann , Luis Machado , Matt Tyrlik MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Message-Id: <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/msg00215.txt.bz2 Hello guys! Long time no see! I have been following the e-mails on the list, but unfortunately I was too busy to join any discussion. Well, hopefully now I will be able to breath a little bit :-). 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. Here's a brief explanation of the new features, with some examples (credit goes to Luis Machado for this explanation): The following features are enabled by the patch: * Hardware Watchpoints (separate items are mutually exclusive) o 2 x Hardware Watchpoints with/without data value check o 1 x Range Hardware Watchpoint o 1 x Mask Hardware Watchpoint * Hardware Breakpoints (separate items are mutually exclusive) o 4 x Hardware Breakpoints o 2 x Range Hardware Breakpoints ---= Hardware Watchpoints =--- * 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 * 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 :>, where <= (rwatch-range/awatch-range/watch- range) - Usage example: watch-range &i,&k / awatch-range 0xbffff8e8,0xbffff8f8 / rwatch-range 0xbffff8e8,+8 * 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 Since the Simple/Range/Mask Hardware Watchpoints share the same register set, the allowed combinations are as follows: - 2 Simple Hardware Watchpoints with/without data value check - 1 Range Hardware Watchpoint - 1 Mask Hardware Watchpoint ---= Hardware Breakpoints =--- * Simple Hardware Breakpoint: Monitors a single instruction address. - Available GDB commands: hbreak
/ hbreak - Usage example: hbreak *0x10000658 / hbreak 20 * Range Hardware Breakpoint: Monitors an interval of instruction addresses. - Available GDB commands: hbreak-range :> where <= / hbreak-range : - Usage example: hbreak-range 0x10000658,0x10000660 / hbreak-range 0x10000658,+8 / hbreak-range 20,30 Since the Simple and Range variations share the same register set, the allowed combinations of Simple Hardware Breakpoints (HW Break) and Range Hardware Breakpoints (Range HW Break) are as follows: - 4 HW Breaks - 1 or 2 HW Breaks / 1 Range HW Break - 2 Range HW Breaks ---- When you review the patches, you will notice that they use a few declarations, defines and statements that do not exist yet. This is because we defined a new interface with the kernel guys from IBM that provides such features. This interface has been defined in collaboration with Benjamin Herrenschmidt (among others), who is the current maintainer of the PowerPC kernel tree. Also, the patch for this new interface has already been posted and is being reviewed by the developers, and the comments received so far do not mention anything about changing the interface, so it is guaranteed that this interface will be accepted upstream as-is. Unfortunately, this patch does not compile if the PowerPC machine doesn't have the updated kernel (with the new interface), but we will fix it ASAP. I have chosen to post it even with this problem in order to let you guys have time to review and comment about the code. It is also important to mention that I still have not written the documentation for the new features, nor a testcase. I plan do that as the review process occurs. Please, let me know if there is anything unclear about this patch. Best regards, -- Sérgio Durigan Júnior Linux on Power Toolchain - Software Engineer Linux Technology Center - LTC IBM Brazil