Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Andrew Cagney <ac131313@cygnus.com>, Kevin Buettner <kevinb@redhat.com>
Cc: Andreas Schwab <schwab@suse.de>, Michal Ludvig <mludvig@suse.cz>,
	gdb-patches@sources.redhat.com
Subject: Re: [RFA] Re: x86-64-tdep.h cleanup
Date: Wed, 06 Mar 2002 11:02:00 -0000	[thread overview]
Message-ID: <1020306190212.ZM23631@localhost.localdomain> (raw)
In-Reply-To: Andrew Cagney <ac131313@cygnus.com> "Re: [RFA] Re: x86-64-tdep.h cleanup" (Mar  6,  1:26pm)

On Mar 6,  1:26pm, Andrew Cagney wrote:

> >> Michal Ludvig <mludvig@suse.cz> writes:
> >> 
> >> |> Andreas Schwab wrote:
> >> |> > I think the registration of the Linux specific gdbarch functions should be
> >> |> > moved to x86-64-linux-tdep.c.
> >> |> > |> It seems reasonable. Perhaps I can do it like in the attachment?
> >> 
> >> No, x86-64-tdep.c should not have _any_ reference to
> >> x86-64-linux-tdep.c.  The former must be usable without the latter.
> > 
> > 
> > How is that possible though?  I've studied this problem for other
> > targets and have (up to now, anyway) concluded that the main tdep.c
> > file is going to need to know about the (OS or ABI) variants in some
> > fashion.
> 
> I think AndreasS is correct.  x86-64-tdep.c only contains ISA and ABI 
> stuff while x86-64-linux.c contains GNU/Linux specific OS functions.
> 
> Two problems are tripping up the theory.  First is that gdbarch doesn't 
> currently groak this arangement - x86-64-linux-tdep is derived (correct 
> O-O word?) from x86-64-tdep.

I'm not sure I agree with this characterization.  As I see it, the
x86-64-linux-tdep.c functions could just as easily have gone in the
main tdep.c file, but it is/was cleaner to put them in their own file.

> The second problem is that gdbarch doesn't 
> handle the concept of OS variants within an ISA/ABI.

Well, maybe not directly, but it is certainly possible use a
gdbarch_tdep struct to describe certain features of the OS in
question.  I use this sort of mechanism on IA-64 to distinguish
between AIX and Linux.  The OS-specific IA-64 tdep files deal with the
same kinds of issues that x86-64-linux-tdep.c is meant to handle.

(See the first sixty lines or so of ia64_gdbarch_init().)

> Up until now people have side stepped the issue by retaining macro 
> definitions in config/*/tm-linux.h.  I'm personally ok with this - it 
> retains the status quo and at least manages to retain the separation.

Yuck.  I don't mind the status quo for targets that haven't completely
converted over to being multiarched yet.  I don't think that we should
encourage a new target to do this though.

Kevin


      reply	other threads:[~2002-03-06 19:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-05  7:56 Michal Ludvig
2002-03-05  8:30 ` Kevin Buettner
2002-03-05 23:53   ` Andreas Jaeger
2002-03-06  2:00   ` Michal Ludvig
2002-03-06  9:30     ` Kevin Buettner
2002-03-07  5:30       ` [patch] " Michal Ludvig
2002-03-06  3:09 ` Andreas Schwab
2002-03-06  8:46   ` [RFA] " Michal Ludvig
2002-03-06  9:24     ` Andreas Schwab
2002-03-06  9:35       ` Kevin Buettner
2002-03-06 10:26         ` Andrew Cagney
2002-03-06 11:02           ` Kevin Buettner [this message]

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=1020306190212.ZM23631@localhost.localdomain \
    --to=kevinb@redhat.com \
    --cc=ac131313@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mludvig@suse.cz \
    --cc=schwab@suse.de \
    /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