This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] ppc/rs6000: use gdbarch_ps_regnum
- From: Kevin Buettner <kevinb at redhat dot com>
- To: Michael Snyder <msnyder at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com, Joel Brobecker <brobecker at gnat dot com>, jimb at redhat dot com
- Date: Fri, 15 Oct 2004 23:18:16 -0700
- Subject: Re: [RFA] ppc/rs6000: use gdbarch_ps_regnum
- Organization: Red Hat
- References: <41706E26.3050804@redhat.com>
On Fri, 15 Oct 2004 17:41:10 -0700
Michael Snyder <msnyder@redhat.com> wrote:
> I just happened to notice this. Gdbarch implements PS_REGNUM,
> so there's no reason to keep it privately in the tdep struct.
Is there some good reason to move it out of the private tdep
struct and into the public eye?
I'll note that ppc_fp0_regnum is also in the tdep struct, and
something comparable (FP0_REGNUM) is also in the gdbarch name space.
Yet, rs6000-tdep does not set FP0_REGNUM via set_gdbarch_fp0_regnum()
and I happen to like it this way. The reason is that there's no good
reason (that I know of) for the other parts of GDB to be aware of this
register numbering. Also, putting the indexes into the tdep struct
gives a uniform mechanism of accessing (most of) the PPC related
register numbers. If we were to move either the PS or FP0 register
number back out to gdbarch, then we'd be accessing some of the
registers via one mechanism and these others via another.
(Unfortunately, we still have SP_REGNUM and PC_REGNUM in gdbarch land.
But there are good reasons for other, non-ppc specific portions to
know about these register numbers.)
Kevin