* Support for PPC405 / PPC440 registers
@ 2007-03-26 20:26 Ignaz Forster
2007-03-26 20:38 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Ignaz Forster @ 2007-03-26 20:26 UTC (permalink / raw)
To: gdb
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
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:
- - bfd/cpu-powerpc: Added definitions for the additional processors in
the struct 'bfd_powerpc_archs'
- - bfd/archures.c: Added processors in 'bfd_architecture'
- - gdb/ppc-tdep.h: Added SPR numbers for new registers
- - gdb/rs6000-tdep.c: Added processors to the struct 'variants' and
created appropriate 'static const struct reg registers_...' entries with
the available registers
After that the registers showed up and could be used after setting the
new processors with "set architecture".
Question 1: What did I destroy by doing this?
Question 2: Would a patch to add support for these processors be useful?
What else should be done before even thinking about doing so?
Thanks,
- --
Ignaz Forster <ignaz.forster@gmx.de>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
iD8DBQFGCCzZ/2+SjQTlQJkRArxWAJ4qrRKwQkaD/0qIuPMaYrAT4TxjSwCgkt7i
W99pT7iGjJ49m3BUO76LeRk=
=xvW9
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Support for PPC405 / PPC440 registers
2007-03-26 20:26 Support for PPC405 / PPC440 registers Ignaz Forster
@ 2007-03-26 20:38 ` Daniel Jacobowitz
2007-03-27 20:33 ` Ignaz Forster
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2007-03-26 20:38 UTC (permalink / raw)
To: Ignaz Forster; +Cc: gdb
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Support for PPC405 / PPC440 registers
2007-03-26 20:38 ` Daniel Jacobowitz
@ 2007-03-27 20:33 ` Ignaz Forster
0 siblings, 0 replies; 3+ messages in thread
From: Ignaz Forster @ 2007-03-27 20:33 UTC (permalink / raw)
To: gdb
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Daniel Jacobowitz schrieb am 26.03.2007 22:38:
> 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
Thanks! This looks exactly like what I was looking for.
> 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
> I'd rather you try the new way, if you have time.
The work was done as part of my diploma thesis and I don't have access
to a PPC board any more - implementing this doesn't sound so trivial...
Hopefully a successor will be able to continue there.
- --
Ignaz Forster <ignaz.forster@gmx.de>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
iD8DBQFGCX/f/2+SjQTlQJkRAgP3AJ4irmZfAYjY+5xwgWqg+ui7JTZtpgCggf9l
U3AXTQkPIvfUBgj+QOQYH0k=
=dHU3
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-03-27 20:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-26 20:26 Support for PPC405 / PPC440 registers Ignaz Forster
2007-03-26 20:38 ` Daniel Jacobowitz
2007-03-27 20:33 ` Ignaz Forster
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox