This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Preparation for OpenBSD/sparc64 core file support
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 24 Jan 2004 21:56:00 +0100 (CET)
- Subject: [PATCH] Preparation for OpenBSD/sparc64 core file support
See the comment in the patch. Doesn't yet allow GDB to recognize
OpenBSD core files on OpenBSD/sparc64, but it's paves the way for a
hack that does.
Committed,
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* sparcnbsd-tdep.c (GDB_OSABI_NETBSD_CORE): Define, based on the
value of GDB_OSABI_DEFAULT.
(sparcnbsd_core_osabi_sniffer): Return GDB_OSABI_NETBSD_CORE
instead of GDB_OSABI_NETBSD_AOUT.
Index: sparcnbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparcnbsd-tdep.c,v
retrieving revision 1.11
diff -u -p -r1.11 sparcnbsd-tdep.c
--- sparcnbsd-tdep.c 22 Jan 2004 23:18:03 -0000 1.11
+++ sparcnbsd-tdep.c 24 Jan 2004 20:49:50 -0000
@@ -284,11 +284,24 @@ sparcnbsd_aout_osabi_sniffer (bfd *abfd)
return GDB_OSABI_UNKNOWN;
}
+/* OpenBSD uses the traditional NetBSD core file format, even for
+ ports that use ELF. Therefore, if the default OS ABI is OpenBSD
+ ELF, we return that instead of NetBSD a.out. This is mainly for
+ the benfit of OpenBSD/sparc64, which inherits the sniffer below
+ since we include this file for an OpenBSD/sparc64 target. For
+ OpenBSD/sparc, the NetBSD a.out OS ABI is probably similar enough
+ to both the OpenBSD a.out and the OpenBSD ELF OS ABI. */
+#if defined (GDB_OSABI_DEFAULT) && (GDB_OSABI_DEFAULT == GDB_OSABI_OPENBSD_ELF)
+#define GDB_OSABI_NETBSD_CORE GDB_OSABI_OPENBSD_ELF
+#else
+#define GDB_OSABI_NETBSD_CORE GDB_OSABI_NETBSD_AOUT
+#endif
+
static enum gdb_osabi
sparcnbsd_core_osabi_sniffer (bfd *abfd)
{
if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0)
- return GDB_OSABI_NETBSD_AOUT;
+ return GDB_OSABI_NETBSD_CORE;
return GDB_OSABI_UNKNOWN;
}