From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20708 invoked by alias); 26 Mar 2007 20:38:46 -0000 Received: (qmail 20695 invoked by uid 22791); 26 Mar 2007 20:38:45 -0000 X-Spam-Check-By: sourceware.org Received: from return.false.org (HELO return.false.org) (66.207.162.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 26 Mar 2007 21:38:42 +0100 Received: from return.false.org (localhost [127.0.0.1]) by return.false.org (Postfix) with ESMTP id 8F9814B267; Mon, 26 Mar 2007 15:38:40 -0500 (CDT) Received: from caradoc.them.org (dsl093-172-095.pit1.dsl.speakeasy.net [66.93.172.95]) by return.false.org (Postfix) with ESMTP id 5DDC54B262; Mon, 26 Mar 2007 15:38:40 -0500 (CDT) Received: from drow by caradoc.them.org with local (Exim 4.63) (envelope-from ) id 1HVvxf-0002KN-64; Mon, 26 Mar 2007 16:38:39 -0400 Date: Mon, 26 Mar 2007 20:38:00 -0000 From: Daniel Jacobowitz To: Ignaz Forster Cc: gdb@sourceware.org Subject: Re: Support for PPC405 / PPC440 registers Message-ID: <20070326203839.GA8617@caradoc.them.org> Mail-Followup-To: Ignaz Forster , gdb@sourceware.org References: <46082CD9.6080002@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46082CD9.6080002@gmx.de> User-Agent: Mutt/1.5.14+cvs20070313 (2007-03-13) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-03/txt/msg00318.txt.bz2 On Mon, Mar 26, 2007 at 10:28:09PM +0200, Ignaz Forster wrote: > I recently tried to debug an embedded IBM PowerPC 405 and 440 over JTAG. > The necessary GDB stub was written by myself (unfortunately using > confidential information, so I won't be able to publish it). > > When trying to display the contents of the processor's registers I > noticed only the PPC403 register layout was included in the standard GDB > distribution. As the registers of the different processors in the > 4xx-series differ, I tried to modify GDB and BFD to handle the registers > of the additional processors. The following files were changed: Since you have your own GDB stub, I would suggest that you approach this from a different direction. The old "set architecture" appproach has a problem: it requires manual intervention, because the architecture of the file doesn't sufficiently tell us what registers the target debug agent can supply. GDB in CVS (after 6.6) has a new approach for customized targets; see the "Target Descriptions" appendix in the current manual, here: http://sourceware.org/gdb/current/onlinedocs/gdb_toc.html There's no PowerPC support for this feature yet. But there's a chapter in the GDB Internals manual which describes how to add support to a new architecture: http://sourceware.org/gdb/current/onlinedocs/gdbint_toc.html Basically, you write a little XML file. Your debug agent tells GDB when it connects that it supports the XML description language, and GDB fetches the description automatically. As long as you mention all the standard core registers, you can add any other registers you please. The new registers go right into the g/G packets, like other registers. > Question 1: What did I destroy by doing this? Probably nothing. > Question 2: Would a patch to add support for these processors be useful? I'd rather you try the new way, if you have time. > What else should be done before even thinking about doing so? If you'd like to contribute to GDB, you'll need a copyright assignment. If you're interested and do not already have one, please let me know and I'll send you the form. -- Daniel Jacobowitz CodeSourcery