This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Check solib bfd arch


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]