This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Check solib bfd arch
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: teawater at gmail dot com (Hui Zhu)
- Cc: gdb-patches at sourceware dot org (gdb-patches ml), msnyder at vmware dot com (Michael Snyder)
- Date: Tue, 7 Jul 2009 18:45:27 +0200 (CEST)
- Subject: 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