Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Jason R Thorpe <thorpej@wasabisystems.com>,
	Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH/RFA] Generic OS ABI handling for PowerPC
Date: Tue, 28 May 2002 14:12:00 -0000	[thread overview]
Message-ID: <1020528204629.ZM29455@localhost.localdomain> (raw)
In-Reply-To: Jason R Thorpe <thorpej@wasabisystems.com> "Re: [PATCH/RFA] Generic OS ABI handling for PowerPC" (May 28, 12:52pm)

On May 28, 12:52pm, Jason R Thorpe wrote:

> On Tue, May 28, 2002 at 12:41:09PM -0700, Kevin Buettner wrote:
> 
>  > Why did you move the SVR4 ABI stuff out of ppc-linux-tdep.c?  I know
>  > there's a FIXME comment to that effect in this file, but I don't think
>  > that rs6000-tdep.c is really the right place for for the SVR4 ABI
>  > code.
> 
> Well, ppc-linux-tdep.c isn't exactly the right place for it, either.

Agreed, but I think it's a better place than rs6000-tdep.c.

> I could add another ppc-tdep.c file, but it seems to me that as long as
> rs6000-tdep.c makes references to sysv abi stuff, it should be actually in
> rs6000-tdep.c.

Umm... rs6000-tdep.c references ppc_linux_* functions too.  Are
you suggesting that they too should be moved to rs6000-tdep.c?

The way I view it is that (for historical reasons) rs6000-tdep.c
contains architecture specific code for the PowerPC and Power
architectures.  It also contains PowerOpen ABI specific code as well
as code specific to the AIX operating system.  BTW, the fact that it
contains PowerOpen ABI specific code is the reason that I object
to moving the SVR4 ABI specific code there.

IMO, ideally, the architecture specific code ought to go in it's own
file.  The ABI-specific code ought to go in separate files of their
own and inherit from the arch specific file.  The OS-dependent code
ought to go in still other files and ought to inherit from the ABI
specific code.  For the Power/PowerPC targets, I'd like to someday
break it down as follows:

    ppc-tdep.c		- generic Power / PowerPC architecture
    ppc-sysv-tdep.c	- PowerPC SysV ABI
    ppc-eabi-tdep.c	- PowerPC EABI
    ppc-poweropen-tdep.c - Power / PowerPC PowerOpen ABI (or whatever
			   it is that IBM's calling it these days.)
    ... (maybe more ABI specific files)
    ppc-linux-tdep.c	- Linux specific code for Power/PowerPC
    ppc-aix-tdep.c	- AIX specific code for Power/PowerPC
    ... (maybe more OS specific files)

The gdbarch machinery doesn't yet have an inheritance mechanism, so,
unfortunately, we're left with the situation whereby (e.g.) the
rs6000_gdbarch_init() function has to refer to a lot of code that it
really shouldn't be referring to.  It also makes arranging the code
as described above somewhat more difficult.

Kevin


  reply	other threads:[~2002-05-28 20:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-28 12:41 Jason R Thorpe
2002-05-28 12:52 ` Kevin Buettner
2002-05-28 13:46   ` Jason R Thorpe
2002-05-28 14:12     ` Kevin Buettner [this message]
2002-05-28 16:35       ` Jason R Thorpe
2002-05-28 16:46         ` Kevin Buettner
2002-05-28 16:47           ` Jason R Thorpe
2002-05-28 19:42             ` Andrew Cagney
2002-05-28 17:59           ` Jason R Thorpe
2002-05-29 17:37             ` Kevin Buettner
2002-05-29 19:08               ` Jason R Thorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1020528204629.ZM29455@localhost.localdomain \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=thorpej@wasabisystems.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox