/* Target-dependent code for NetBSD/sh.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2020 Free Software Foundation, Inc.
Contributed by Wasabi Systems, Inc.
#include "osabi.h"
#include "sh-tdep.h"
+#include "nbsd-tdep.h"
#include "solib-svr4.h"
+#include "gdbarch.h"
/* Convert a register number into an offset into a ptrace
register structure. */
struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ nbsd_init_abi (info, gdbarch);
tdep->core_gregmap = (struct sh_corefile_regmap *)regmap;
tdep->sizeof_gregset = 84;
set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_ilp32_fetch_link_map_offsets);
}
-\f
-
-/* OpenBSD uses uses the traditional NetBSD core file format, even for
- ports that use ELF. */
-#define GDB_OSABI_NETBSD_CORE GDB_OSABI_OPENBSD_ELF
-
-static enum gdb_osabi
-shnbsd_core_osabi_sniffer (bfd *abfd)
-{
- if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0)
- return GDB_OSABI_NETBSD_CORE;
-
- return GDB_OSABI_UNKNOWN;
-}
-
-/* Provide a prototype to silence -Wmissing-prototypes. */
-extern initialize_file_ftype _initialize_shnbsd_tdep;
+void _initialize_shnbsd_tdep ();
void
-_initialize_shnbsd_tdep (void)
+_initialize_shnbsd_tdep ()
{
- /* BFD doesn't set a flavour for NetBSD style a.out core files. */
- gdbarch_register_osabi_sniffer (bfd_arch_sh, bfd_target_unknown_flavour,
- shnbsd_core_osabi_sniffer);
-
- gdbarch_register_osabi (bfd_arch_sh, 0, GDB_OSABI_NETBSD_ELF,
+ gdbarch_register_osabi (bfd_arch_sh, 0, GDB_OSABI_NETBSD,
shnbsd_init_abi);
- gdbarch_register_osabi (bfd_arch_sh, 0, GDB_OSABI_OPENBSD_ELF,
+ gdbarch_register_osabi (bfd_arch_sh, 0, GDB_OSABI_OPENBSD,
shnbsd_init_abi);
}