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]

[0/8] solib handler rework


Hello,

one of the last remaining obstacles to enabling supporting multiple
targets at the same time the current_target_so_ops global variable.
Each variant of shared library handler currently set that variable
in its initialization function, making it impossible to link more
than one shared library handler into a single GDB binary.

This series of patches fixes this problem by moving selection of
the proper shared library handler to the target architecture; the
approriate gdbarch init function will call set_solib_ops.

One twist is that some solib handlers cannot even be compiled 
except on the native configuration, because they make use of
platform specific header files or libraries.  This patch series
does not fix this problem, but at least stops it hurting other
platforms.  After the patch series is applied, there are two
classes of solib handlers:

- Native-only solib: File is compiled and linked only in native
  configurations (via NATDEPFILES), it installs itself via the
  global current_target_so_ops, and there are no references from
  any tdep file to the solib file.

- Cross-platform solib: File can be compiled and linked on an
  arbitrary host platform; it *is* compiled and linked on both
  cross and native configurations (via TDEPFILES), it does *not*
  touch current_target_so_ops.  There *may* be references from
  tdep files (for the same configuration) to the solib file.


This implies that any cross-debugger configuration will be able
to debug shared libraries correctly, as long as the target system
uses a cross-platform solib.  In the future, it will be possible
to build multi-target configurations that support multiple
different solib handlers simultaneously.


After the patch series is applied, the only remaining native-only
solib handlers will in fact be solib-sunos and solib-osf.  Those
could probably converted to cross-platform handlers as well, by
removing dependencies on native header files.  I'll leave that
part to someone who has access to those platforms ...


The whole series was tested on s390-linux, s390x-linux, powerpc-
linux, i386-linux, and ia64-linux.   Tests on other affected
platforms would be welcome: alpha-linux, arm-wince, arm-linux,
i386-gnu, i386-cygwin, i386-nto, m32r-linux, hppa-hpux (32-bit
and 64-bit), mips-irix, and frv.

OK to apply to mainline?

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]