aboutsummaryrefslogtreecommitdiff
path: root/gdb/armobsd-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2006-08-02 21:32:37 +0000
committerMark Kettenis <kettenis@gnu.org>2006-08-02 21:32:37 +0000
commit47ccd04848b5dac105ea353a2a98019c49d3000a (patch)
treefeb00c96dc77ff51bfc35e08e335eb9aa66b65b0 /gdb/armobsd-tdep.c
parent9d7cbccda0d0b223261e33efb609a7a43401ec5e (diff)
downloadgdb-47ccd04848b5dac105ea353a2a98019c49d3000a.zip
gdb-47ccd04848b5dac105ea353a2a98019c49d3000a.tar.gz
gdb-47ccd04848b5dac105ea353a2a98019c49d3000a.tar.bz2
* arm-tdep.h: Add multiple inclusion protection.
(struct gdbarch): Add forward declaration. (armobsd_regset_from_core_section): New prototype. * armbsd-tdep.c: New file. * armobsd-tdep.c: Include "gdb_string.h". (armobsd_init_abi): Set regset_from_core_section. (armobsd_core_osabi_sniffer): New function. (_initialize_armobsd_tdep): Register armobsd_core_osabi_sniffer. * Makefile.in (ALLDEPFILES): Add armbsd-tdep.c. (armbsd-tdep.o): New dependency. (armnbsd-tdep.o): Update dependencies. * config/arm/obsd.mt (TDEPFILES): Add armbsd-tdep.o and corelow.o.
Diffstat (limited to 'gdb/armobsd-tdep.c')
-rw-r--r--gdb/armobsd-tdep.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/armobsd-tdep.c b/gdb/armobsd-tdep.c
index 9b14382..cc769b7 100644
--- a/gdb/armobsd-tdep.c
+++ b/gdb/armobsd-tdep.c
@@ -24,6 +24,8 @@
#include "trad-frame.h"
#include "tramp-frame.h"
+#include "gdb_string.h"
+
#include "obsd-tdep.h"
#include "arm-tdep.h"
#include "solib-svr4.h"
@@ -89,13 +91,30 @@ armobsd_init_abi (struct gdbarch_info info,
tdep->jb_pc = 24;
tdep->jb_elt_size = 4;
+ set_gdbarch_regset_from_core_section
+ (gdbarch, armbsd_regset_from_core_section);
+
/* OpenBSD/arm uses -fpcc-struct-return by default. */
tdep->struct_return = pcc_struct_return;
}
+
+
+static enum gdb_osabi
+armobsd_core_osabi_sniffer (bfd *abfd)
+{
+ if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0)
+ return GDB_OSABI_OPENBSD_ELF;
+
+ return GDB_OSABI_UNKNOWN;
+}
void
_initialize_armobsd_tdep (void)
{
+ /* BFD doesn't set a flavour for NetBSD style a.out core files. */
+ gdbarch_register_osabi_sniffer (bfd_arch_arm, bfd_target_unknown_flavour,
+ armobsd_core_osabi_sniffer);
+
gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_OPENBSD_ELF,
armobsd_init_abi);
}