This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Check solib bfd arch
- From: Daniel Jacobowitz <drow at false dot org>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: Pedro Alves <pedro at codesourcery dot com>, gdb-patches at sourceware dot org, Mark Kettenis <mark dot kettenis at xs4all dot nl>, brobecker at adacore dot com, teawater at gmail dot com, msnyder at vmware dot com
- Date: Fri, 18 Sep 2009 12:25:11 -0400
- Subject: Re: [RFA] Check solib bfd arch
- References: <200909181553.45603.pedro@codesourcery.com> <200909181614.n8IGEWWB006667@d12av02.megacenter.de.ibm.com>
On Fri, Sep 18, 2009 at 06:14:32PM +0200, Ulrich Weigand wrote:
> Pedro Alves wrote:
>
> > Could we compare the solib's target arch with
> > tdesc_architecture(target_read_description()) directly --- but only
> > if available ---, instead of comparing it with target_gdbarch?
>
> Hmm, this would ignore the work done by choose_architecture_for_target.
>
> Maybe we should compare against target_gdbarch, but only if a target
> description is present? Just wrap the whole test as-is in a
> if (target_read_description ())
> ...
A description can cover many areas, but is not required to cover any
of them. I don't think anything should rely on "is there a
description".
It does seem to me like the test should be symmetric here:
a = bfd_get_arch_info (abfd);
if (b->compatible (b, a) != b
&& a->compatible (a, b) != a)
The current version is only right if we know the most specific
supported architecture for the target, which I think is not the
question we ought to ask. We get away with this in osabi.c because we
know that handler->arch_info is the most general supported
architecture for the OSABI handler.
--
Daniel Jacobowitz
CodeSourcery