This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Support for PPC405 / PPC440 registers


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]