From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18160 invoked by alias); 30 Oct 2007 21:30:35 -0000 Received: (qmail 18147 invoked by uid 22791); 30 Oct 2007 21:30:34 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate3.de.ibm.com (HELO mtagate3.de.ibm.com) (195.212.29.152) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 30 Oct 2007 21:30:32 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.13.8/8.13.8) with ESMTP id l9ULUTg2079246 for ; Tue, 30 Oct 2007 21:30:29 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 l9ULUST12269298 for ; Tue, 30 Oct 2007 22:30:28 +0100 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 l9ULUSBw010136 for ; Tue, 30 Oct 2007 22:30:28 +0100 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 l9ULUS1m010133; Tue, 30 Oct 2007 22:30:28 +0100 Message-Id: <200710302130.l9ULUS1m010133@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 30 Oct 2007 22:30:28 +0100 Subject: Re: [rfc] [7/9] Multi-target support: Fix GDB_OSABI_OPENBSD_AOUT problem To: mark.kettenis@xs4all.nl (Mark Kettenis) Date: Tue, 30 Oct 2007 21:36:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <200710292031.l9TKVmCP010779@brahms.sibelius.xs4all.nl> from "Mark Kettenis" at Oct 29, 2007 09:31:48 PM 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/msg00833.txt.bz2 Mark Kettenis wrote: > > On vax, both NetBSD and OpenBSD want to install an OSABI handler, > > so this *is* a problem. However, the NetBSD OSABI handler doesn't > > actually do anything -- do you know the status of NetBSD/vax? > > NetBSD/vax has been using ELF since NetBSD 1.5 or 1.6. I guess this > means NetBSD/vax a.out could be dropped. It appears there was no osabi sniffer installed that would ever return GDB_OSABI_NETBSD_AOUT on the NetBSD/vax target, so removing the (empty) OSABI handler should actually not change the behaviour at all ... > > > If we can resolve the vax question, and indeed drop a.out support > > for either NetBSD/i386 or OpenBSD/i386, this would solve the problem > > as well. > > Probably both can be dropped. NetBSD/i386 started using ELF before > OpenBSD/i386, but I have no problem with dropping OpenBSD/i386 a.out > support. The following patch is the minimal solution to the re-defined handler problem, by dropping the (obsolete) NetBSD/vax a.out handler, and by removing OpenBSD/i386 a.out support. (If you prefer, I'm certainly fine with removing NetBSD/i386 a.out as well ...) Would this be OK? Bye, Ulrich ChangeLog: * i386obsd-tdep.c (i386obsd_aout_supply_regset): Remove. (i386obsd_aout_regset_from_core_section): Likewise. (i386obsd_aout_init_abi): Likewise. (_initialize_i386obsd_tdep): Do not register i386obsd_aout_init_abi. (GDB_OSABI_OPENBSD_AOUT): Do not define. * vaxnbsd-tdep.c (vaxnbsd_aout_init_abi): Remove. (_initialize_vaxnbsd_tdep): Do not register vaxnbsd_aout_init_abi. diff -urNp gdb-orig/gdb/i386obsd-tdep.c gdb-head/gdb/i386obsd-tdep.c --- gdb-orig/gdb/i386obsd-tdep.c 2007-10-26 01:31:07.000000000 +0200 +++ gdb-head/gdb/i386obsd-tdep.c 2007-10-30 20:03:09.012085344 +0100 @@ -136,42 +136,6 @@ static int i386obsd_r_reg_offset[] = 14 * 4, /* %fs */ 15 * 4 /* %gs */ }; - -static void -i386obsd_aout_supply_regset (const struct regset *regset, - struct regcache *regcache, int regnum, - const void *regs, size_t len) -{ - const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch); - const gdb_byte *gregs = regs; - - gdb_assert (len >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE); - - i386_supply_gregset (regset, regcache, regnum, regs, tdep->sizeof_gregset); - i387_supply_fsave (regcache, regnum, gregs + tdep->sizeof_gregset); -} - -static const struct regset * -i386obsd_aout_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, - size_t sect_size) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - - /* OpenBSD a.out core dumps don't use seperate register sets for the - general-purpose and floating-point registers. */ - - if (strcmp (sect_name, ".reg") == 0 - && sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE) - { - if (tdep->gregset == NULL) - tdep->gregset = - regset_alloc (gdbarch, i386obsd_aout_supply_regset, NULL); - return tdep->gregset; - } - - return NULL; -} /* Sigtramp routine location for OpenBSD 3.1 and earlier releases. */ @@ -474,18 +438,6 @@ i386obsd_init_abi (struct gdbarch_info i frame_unwind_prepend_unwinder (gdbarch, &i386obsd_trapframe_unwind); } -/* OpenBSD a.out. */ - -static void -i386obsd_aout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) -{ - i386obsd_init_abi (info, gdbarch); - - /* OpenBSD a.out has a single register set. */ - set_gdbarch_regset_from_core_section - (gdbarch, i386obsd_aout_regset_from_core_section); -} - /* OpenBSD ELF. */ static void @@ -511,14 +463,6 @@ void _initialize_i386obsd_tdep (void); void _initialize_i386obsd_tdep (void) { - /* FIXME: kettenis/20021020: Since OpenBSD/i386 binaries are - indistingushable from NetBSD/i386 a.out binaries, building a GDB - that should support both these targets will probably not work as - expected. */ -#define GDB_OSABI_OPENBSD_AOUT GDB_OSABI_NETBSD_AOUT - - gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_OPENBSD_AOUT, - i386obsd_aout_init_abi); gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_OPENBSD_ELF, i386obsd_elf_init_abi); } diff -urNp gdb-orig/gdb/vaxnbsd-tdep.c gdb-head/gdb/vaxnbsd-tdep.c --- gdb-orig/gdb/vaxnbsd-tdep.c 2007-08-23 20:08:47.000000000 +0200 +++ gdb-head/gdb/vaxnbsd-tdep.c 2007-10-30 19:59:53.808570506 +0100 @@ -26,13 +26,6 @@ #include "gdb_string.h" -/* NetBSD a.out. */ - -static void -vaxnbsd_aout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) -{ -} - /* NetBSD ELF. */ static void @@ -50,8 +43,6 @@ void _initialize_vaxnbsd_tdep (void); void _initialize_vaxnbsd_tdep (void) { - gdbarch_register_osabi (bfd_arch_vax, 0, GDB_OSABI_NETBSD_AOUT, - vaxnbsd_aout_init_abi); gdbarch_register_osabi (bfd_arch_vax, 0, GDB_OSABI_NETBSD_ELF, vaxnbsd_elf_init_abi); } -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com