From 47ccd04848b5dac105ea353a2a98019c49d3000a Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Wed, 2 Aug 2006 21:32:37 +0000 Subject: * 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. --- gdb/armobsd-tdep.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gdb/armobsd-tdep.c') diff --git a/gdb/armobsd-tdep.c b/gdb/armobsd-tdep.c index 9b14382a7d7..cc769b70486 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); } -- cgit v1.2.1