Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: Kevin Buettner <kevinb@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFA] Add support for 64-bit MIPS GNU/Linux targets
Date: Wed, 08 Jan 2003 00:00:00 -0000	[thread overview]
Message-ID: <3E1B69CB.2030207@redhat.com> (raw)
In-Reply-To: <20030107231621.GF20617@nevyn.them.org>

> On Mon, Jan 06, 2003 at 07:24:35PM -0500, Andrew Cagney wrote:
> 
>> >+  register_addr_data =
> 
>> >>+    register_gdbarch_data (init_register_addr_data, 0);
>> >>+
>> >>   gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_LINUX,
>> >> 			  mips_linux_init_abi);
>> >>   add_core_fns (&regset_core_fns);
> 
>> >
>> >
>> >Blech.  So, the way _I_ would have done this would have been to put
>> >this in the tdep structure.  In fact I have several patches which add
>> >similar methods to the tdep structure, for signal handling.  Of course,
>> >this is not compatible with the way Andrew asked to leave the tdep
>> >struct in mips-tdep.c.  This is OK for now, but hopefully we can get
>> >rid of it eventually.  We could multi-arch register_addr (is that
>> >appropriate?  It's a native-only function, isn't it?) to do that.
>> >
> 
>> 
>> Using the gdbarch data mechanism is a good idea - it keeps that 
>> architecture dependency local to that file.  It definitly doesn't belong 
>> in the tdep structure since nothing, other than this file, needs it.
>> 
>> Hmm, should the actual code live in mips-linux-nat.c though?
> 
> 
> Well, here's the situation: other files call register_addr.  I think
> core-regset?  It's a native only method, but which one we want depends
> on the current gdbarch.  I suppose we can just use a gdbarch_data to
> handle this, but it seems as if there should be a better way.  Should
> it be properly multi-arched (is there any point?)?

The method register_addr() is a static interface between the nat code 
and the ptrace code, not the core of GDB and the ISA/ABI.  Hence, it 
doesn't belong in the architecture vector (which is for interfaces 
between the latter two).

As for implementation, there are two choices:

- as kevin did
- as a function that contains a switch to handle the specific cases

That leaves the question, should the function live in mips-linux-nat.c?

Andrew



      reply	other threads:[~2003-01-08  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-23 15:07 Kevin Buettner
2002-12-23 16:01 ` Daniel Jacobowitz
2002-12-23 22:37   ` Kevin Buettner
2002-12-24  9:25     ` Daniel Jacobowitz
2002-12-24 11:37       ` Kevin Buettner
2002-12-24 12:09         ` Daniel Jacobowitz
2002-12-24 19:25           ` Kevin Buettner
2003-01-07  0:26   ` Andrew Cagney
2003-01-07 23:16     ` Daniel Jacobowitz
2003-01-08  0:00       ` Andrew Cagney [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=3E1B69CB.2030207@redhat.com \
    --to=ac131313@redhat.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kevinb@redhat.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