This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Cell multi-arch symbol lookup broken (Re: [PATCH] solib_global_lookup: Fetch arch from objfile.)
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: xdje42 at gmail dot com (Doug Evans)
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 27 Aug 2015 16:01:41 +0200 (CEST)
- Subject: Cell multi-arch symbol lookup broken (Re: [PATCH] solib_global_lookup: Fetch arch from objfile.)
- Authentication-results: sourceware.org; auth=none
Doug Evans wrote:
> solib_global_lookup should be using the objfile's arch,
> not fetching it from global state.
>
> Regression tested on amd64-linux.
>
> 2014-10-31 Doug Evans <xdje42@gmail.com>
>
> * objfiles.c (get_objfile_arch): Constify.
> * objfiles.h (get_objfile_arch): Update prototype.
> * solib.c (solib_global_lookup): Fetch arch from objfile,
> not target_gdbarch.
This also causes a regression in Cell multi-arch debugging.
The problem is that solib_ops are really only installed for
the main target_gdbarch. As opposed to many other things,
there is just a single solib_ops vector, intended to describe
the dynamic loader in use on the inferior. While it can make
sense to have multiple loaders when debugging different
inferiors, within a single inferior we support only one.
The solib_global_lookup routine was intended to describe the
operation of that (single) dynamic loader, so that GDB's symbol
lookup can achieve the same result as the native dynamic loader
would. That's why we added that routine to the solib_ops.
On Cell, the dynamic loader runs on the PowerPC side (which
is was target_gdbarch () returns), and so we installed the
solib_ops there. The Cell implementation of solib_global_lookup
then handles both PowerPC and SPU objects.
However, after your patch, this implementation now never gets
called for SPU objects any more, which means the special
lookup rules are no longer implemented.
Simply reverting this patch makes everything work for me again.
Was there any specific reason why you made this change in the
first place? Does this fix any specific problem?
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com