Add multi-target tests
[deliverable/binutils-gdb.git] / gdb / alpha-nbsd-tdep.c
index 00ff4814069e21c919698ac5a91a97a310326ae2..8e8c45341922a40d80435ce3f21a85a437433147 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for NetBSD/alpha.
 
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2020 Free Software Foundation, Inc.
 
    Contributed by Wasabi Systems, Inc.
 
@@ -35,9 +35,6 @@
 
 /* Core file support.  */
 
-/* Even though NetBSD/alpha used ELF since day one, it used the
-   traditional a.out-style core dump format before NetBSD 1.6.  */
-
 /* Sizeof `struct reg' in <machine/reg.h>.  */
 #define ALPHANBSD_SIZEOF_GREGS (32 * 8)
 
@@ -61,11 +58,11 @@ alphanbsd_supply_fpregset (const struct regset *regset,
   for (i = ALPHA_FP0_REGNUM; i < ALPHA_FP0_REGNUM + 31; i++)
     {
       if (regnum == i || regnum == -1)
-       regcache_raw_supply (regcache, i, regs + (i - ALPHA_FP0_REGNUM) * 8);
+       regcache->raw_supply (i, regs + (i - ALPHA_FP0_REGNUM) * 8);
     }
 
   if (regnum == ALPHA_FPCR_REGNUM || regnum == -1)
-    regcache_raw_supply (regcache, ALPHA_FPCR_REGNUM, regs + 32 * 8);
+    regcache->raw_supply (ALPHA_FPCR_REGNUM, regs + 32 * 8);
 }
 
 /* Supply register REGNUM from the buffer specified by GREGS and LEN
@@ -98,11 +95,11 @@ alphanbsd_aout_supply_gregset (const struct regset *regset,
   for (i = 0; i < ARRAY_SIZE(regmap); i++)
     {
       if (regnum == i || regnum == -1)
-       regcache_raw_supply (regcache, i, regs + regmap[i] * 8);
+       regcache->raw_supply (i, regs + regmap[i] * 8);
     }
 
   if (regnum == ALPHA_PC_REGNUM || regnum == -1)
-    regcache_raw_supply (regcache, ALPHA_PC_REGNUM, regs + 31 * 8);
+    regcache->raw_supply (ALPHA_PC_REGNUM, regs + 31 * 8);
 
   if (len >= ALPHANBSD_SIZEOF_GREGS + ALPHANBSD_SIZEOF_FPREGS)
     {
@@ -133,11 +130,11 @@ alphanbsd_supply_gregset (const struct regset *regset,
   for (i = 0; i < ALPHA_ZERO_REGNUM; i++)
     {
       if (regnum == i || regnum == -1)
-       regcache_raw_supply (regcache, i, regs + i * 8);
+       regcache->raw_supply (i, regs + i * 8);
     }
 
   if (regnum == ALPHA_PC_REGNUM || regnum == -1)
-    regcache_raw_supply (regcache, ALPHA_PC_REGNUM, regs + 31 * 8);
+    regcache->raw_supply (ALPHA_PC_REGNUM, regs + 31 * 8);
 }
 
 /* NetBSD/alpha register sets.  */
@@ -164,8 +161,10 @@ alphanbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                        void *cb_data,
                                        const struct regcache *regcache)
 {
-  cb (".reg", ALPHANBSD_SIZEOF_GREGS, &alphanbsd_gregset, NULL, cb_data);
-  cb (".reg2", ALPHANBSD_SIZEOF_FPREGS, &alphanbsd_fpregset, NULL, cb_data);
+  cb (".reg", ALPHANBSD_SIZEOF_GREGS, ALPHANBSD_SIZEOF_GREGS,
+      &alphanbsd_gregset, NULL, cb_data);
+  cb (".reg2", ALPHANBSD_SIZEOF_FPREGS, ALPHANBSD_SIZEOF_FPREGS,
+      &alphanbsd_fpregset, NULL, cb_data);
 }
 \f
 
@@ -279,26 +278,12 @@ alphanbsd_init_abi (struct gdbarch_info info,
 }
 \f
 
-static enum gdb_osabi
-alphanbsd_core_osabi_sniffer (bfd *abfd)
-{
-  if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0)
-    return GDB_OSABI_NETBSD_ELF;
-
-  return GDB_OSABI_UNKNOWN;
-}
-\f
-
-/* Provide a prototype to silence -Wmissing-prototypes.  */
-void _initialize_alphanbsd_tdep (void);
-
 void
 _initialize_alphanbsd_tdep (void)
 {
-  /* BFD doesn't set a flavour for NetBSD style a.out core files.  */
-  gdbarch_register_osabi_sniffer (bfd_arch_alpha, bfd_target_unknown_flavour,
-                                  alphanbsd_core_osabi_sniffer);
-
-  gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_NETBSD_ELF,
+  /* Even though NetBSD/alpha used ELF since day one, it used the
+     traditional a.out-style core dump format before NetBSD 1.6, but
+     we don't support those.  */
+  gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_NETBSD,
                           alphanbsd_init_abi);
 }
This page took 0.026759 seconds and 4 git commands to generate.