This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Add support for OpenBSD/sparc and OpenBSD/sparc64
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 23 Jan 2004 00:18:31 +0100 (CET)
- Subject: [PATCH] Add support for OpenBSD/sparc and OpenBSD/sparc64
OpenBSD and NetBSD are very similar, so using the same architecture
vector for both results in a GDB that provides enough basic
functionality to work. Things that don't work on OpenBSD yet:
* Signal handler support.
* Core file support.
* Calling functions (on OpenBSD/sparc).
The last issue has to do with OpenBSD's non-executable stack, but
that's not difficult to solve in GDB. I'm just not quite sure how to
implement it. Expect an RFC soon.
Floating-point support on OpenBSD/sparc64 is completely broken due to
bugs in the soft-float routines and/or the floating-point emulator.
I'm not quite sure how to solve that :-(.
Committed,
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* NEWS (New native configurations): Mention OpenBSD/sparc and
OpenBSD/sparc64.
* configure.tgt: Add sparc-*-openbsd* and sparc64-*-openbsd*.
* configure.host: Likewise.
* sparcnbsd-tdep.c (_initialize_sparnbsd_tdep): Register OS ABI
handler for OpenBSD.
* sparc64nbsd-tdep.c (_initialize_sparc64nbsd_tdep): Likewise.
Index: NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.133
diff -u -p -r1.133 NEWS
--- NEWS 20 Jan 2004 09:29:13 -0000 1.133
+++ NEWS 22 Jan 2004 23:09:48 -0000
@@ -37,6 +37,8 @@ encountered these.
* New native configurations
NetBSD/amd64 x86_64-*-netbsd*
+OpenBSD/sparc sparc-*-openbsd*
+OpenBSD/sparc64 sparc64-*-openbsd*
* New debugging protocols
Index: configure.host
===================================================================
RCS file: /cvs/src/src/gdb/configure.host,v
retrieving revision 1.63
diff -u -p -r1.63 configure.host
--- configure.host 3 Jan 2004 10:08:44 -0000 1.63
+++ configure.host 22 Jan 2004 23:09:48 -0000
@@ -132,6 +132,8 @@ sparc-*-netbsdelf*) gdb_host=nbsdelf ;;
sparc-*-netbsdaout*) gdb_host=nbsdaout ;;
sparc-*-netbsd*) gdb_host=nbsdaout ;;
sparc64-*-netbsd*) gdb_host=nbsd64 ;;
+sparc-*-openbsd*) gdb_host=nbsdelf ;;
+sparc64-*-openbsd*) gdb_host=nbsd64 ;;
sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*)
gdb_host=sol2
;;
Index: configure.tgt
===================================================================
RCS file: /cvs/src/src/gdb/configure.tgt,v
retrieving revision 1.125
diff -u -p -r1.125 configure.tgt
--- configure.tgt 3 Jan 2004 12:09:47 -0000 1.125
+++ configure.tgt 22 Jan 2004 23:09:48 -0000
@@ -190,6 +190,8 @@ sparc-*-linux*) gdb_target=linux ;;
sparc64-*-linux*) gdb_target=linux64 ;;
sparc-*-netbsd*) gdb_target=nbsd ;;
sparc64-*-netbsd*) gdb_target=nbsd64 ;;
+sparc-*-openbsd*) gdb_target=nbsd ;;
+sparc64-*-openbsd*) gdb_target=nbsd64 ;;
sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
gdb_target=sol2
;;
Index: sparcnbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparcnbsd-tdep.c,v
retrieving revision 1.10
diff -u -p -r1.10 sparcnbsd-tdep.c
--- sparcnbsd-tdep.c 22 Jan 2004 22:57:59 -0000 1.10
+++ sparcnbsd-tdep.c 22 Jan 2004 23:09:48 -0000
@@ -312,4 +312,6 @@ _initialize_sparnbsd_tdep (void)
sparc32nbsd_aout_init_abi);
gdbarch_register_osabi (bfd_arch_sparc, 0, GDB_OSABI_NETBSD_ELF,
sparc32nbsd_elf_init_abi);
+ gdbarch_register_osabi (bfd_arch_sparc, 0, GDB_OSABI_OPENBSD_ELF,
+ sparc32nbsd_elf_init_abi);
}
Index: sparc64nbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc64nbsd-tdep.c,v
retrieving revision 1.3
diff -u -p -r1.3 sparc64nbsd-tdep.c
--- sparc64nbsd-tdep.c 11 Jan 2004 20:52:29 -0000 1.3
+++ sparc64nbsd-tdep.c 22 Jan 2004 23:09:48 -0000
@@ -243,4 +243,6 @@ _initialize_sparc64nbsd_tdep (void)
{
gdbarch_register_osabi (bfd_arch_sparc, bfd_mach_sparc_v9,
GDB_OSABI_NETBSD_ELF, sparc64nbsd_init_abi);
+ gdbarch_register_osabi (bfd_arch_sparc, bfd_mach_sparc_v9,
+ GDB_OSABI_OPENBSD_ELF, sparc64nbsd_init_abi);
}