From: Kevin Buettner <kevinb@redhat.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Add support for 64-bit MIPS GNU/Linux targets
Date: Tue, 24 Dec 2002 19:25:00 -0000 [thread overview]
Message-ID: <1021225003413.ZM28148@localhost.localdomain> (raw)
In-Reply-To: Daniel Jacobowitz <drow@mvista.com> "Re: [RFA] Add support for 64-bit MIPS GNU/Linux targets" (Dec 24, 2:40pm)
On Dec 24, 2:40pm, Daniel Jacobowitz wrote:
[...]
> > I found it necessary to change the osabi registration (in mips-linux-tdep.c)
> > from:
> >
> > gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_LINUX,
> > mips_linux_init_abi);
> >
> > to:
> >
> > for (arch_info = bfd_lookup_arch (bfd_arch_mips, 0);
> > arch_info != NULL;
> > arch_info = arch_info->next)
> > {
> > gdbarch_register_osabi (bfd_arch_mips, arch_info->mach, GDB_OSABI_LINUX,
> > mips_linux_init_abi);
> > }
> >
> > I'm not entirely happy with this change, but I see no way around it
> > due to the recent changes to osabi.c. (I'm open to suggestions for
> > better ways to do it...)
>
> OK, that's a problem. In fact it's disgusting... A mach value of 0 is
> always supposed to mean "default", if I remember my BFD correctly. Has
> the change to pass a machine of 0 broken osabi support for anything
> that sets a machine? It looks that way.
I wonder if Mark made a mistake in his recent change to gdbarch_init_osabi(),
specifically in the following code:
for (handler = gdb_osabi_handler_list; handler != NULL;
handler = handler->next)
{
if (handler->osabi != osabi)
continue;
/* Check whether the machine type and architecture of the
handler are compatible with the desired machine type and
architecture.
NOTE: kettenis/20021027: There may be more than one machine
type that is compatible with the desired machine type. Right
now we simply return the first match, which is fine for now.
However, we might want to do something smarter in the future. */
compatible = arch_info->compatible (arch_info, handler->arch_info);
if (compatible == handler->arch_info)
{
(*handler->init_osabi) (info, gdbarch);
return;
}
}
For MIPS, the compatible() function is defined as follows:
static const bfd_arch_info_type *
mips_compatible (a, b)
const bfd_arch_info_type *a;
const bfd_arch_info_type *b;
{
if (a->arch != b->arch)
return NULL;
/* Machine compatibility is checked in
_bfd_mips_elf_merge_private_bfd_data. */
return a;
}
So... the first argument is returned when the ``arch'' fields are the
same, and NULL otherwise. Thus, for MIPS, the following bit of
code:
compatible = arch_info->compatible (arch_info, handler->arch_info);
if (compatible == handler->arch_info)
...
means the same as:
if (arch_info == handler->arch_info)
...
which seems overly restrictive and not at all in the spirit of the
comment preceding that bit of code.
Kevin
next prev parent reply other threads:[~2002-12-25 0:34 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 [this message]
2003-01-07 0:26 ` Andrew Cagney
2003-01-07 23:16 ` Daniel Jacobowitz
2003-01-08 0:00 ` Andrew Cagney
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=1021225003413.ZM28148@localhost.localdomain \
--to=kevinb@redhat.com \
--cc=drow@mvista.com \
--cc=gdb-patches@sources.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