[RFA] Check solib bfd arch

Ulrich Weigand uweigand@de.ibm.com
Tue Jul 7 16:45:00 GMT 2009


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



More information about the Gdb-patches mailing list