From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10564 invoked by alias); 19 Oct 2007 21:31:41 -0000 Received: (qmail 10551 invoked by uid 22791); 19 Oct 2007 21:31:40 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate8.de.ibm.com (HELO mtagate8.de.ibm.com) (195.212.29.157) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 19 Oct 2007 21:31:37 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate8.de.ibm.com (8.13.8/8.13.8) with ESMTP id l9JLVYAh357838 for ; Fri, 19 Oct 2007 21:31:34 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.5) with ESMTP id l9JLVYCx1745070 for ; Fri, 19 Oct 2007 23:31:34 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l9JLVYjD002499 for ; Fri, 19 Oct 2007 23:31:34 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id l9JLVYuv002496 for ; Fri, 19 Oct 2007 23:31:34 +0200 Message-Id: <200710192131.l9JLVYuv002496@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 19 Oct 2007 23:31:34 +0200 Subject: [0/8] solib handler rework To: gdb-patches@sourceware.org Date: Fri, 19 Oct 2007 21:32:00 -0000 From: "Ulrich Weigand" X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-10/txt/msg00458.txt.bz2 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