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


Hui Zhu wrote:

> +  /* Check bfd arch.  */
> +  b = gdbarch_bfd_arch_info (target_gdbarch);
> +  if (b->compatible (b, bfd_get_arch_info (abfd)) != b)
> +    {
> +      bfd_close (abfd);
> +      make_cleanup (xfree, found_pathname);
> +      error (_("`%s': ARCH not same with inferior."), found_pathname);
> +    }

I'm not sure this should be an error; we allow debugging a main
executable whose architecture does not match the target architecture
(if the user knows what they're doing), so IMO we should allow this
for shared libraries too.  A *warning* would be more appropriate.

Also, I think it would be good if the message mentioned the architecture
in question, along the lines of:

  warning (_("`%s': Shared library architecture %s is not compatible "
             "with target architecture %s."), found_pathname,
           bfd_get_arch_info (abfd)->printable_name, b->printable_name);

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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