Correct invalid assumptions made by (mostly) DWARF-2 tests
[deliverable/binutils-gdb.git] / gdb / m68kbsd-tdep.c
index e59bc668ce761fa3849b43156b4606b40811ddc1..a329eabac92b059c772097367bd52a5152c8c62e 100644 (file)
@@ -27,9 +27,6 @@
 #include "tramp-frame.h"
 #include "gdbtypes.h"
 
-#include "gdb_assert.h"
-#include <string.h>
-
 #include "m68k-tdep.h"
 #include "solib-svr4.h"
 
@@ -105,32 +102,28 @@ m68kbsd_supply_gregset (const struct regset *regset,
 
 /* Motorola 68000 register sets.  */
 
-static struct regset m68kbsd_gregset =
+static const struct regset m68kbsd_gregset =
 {
   NULL,
   m68kbsd_supply_gregset
 };
 
-static struct regset m68kbsd_fpregset =
+static const struct regset m68kbsd_fpregset =
 {
   NULL,
   m68kbsd_supply_fpregset
 };
 
-/* Return the appropriate register set for the core section identified
-   by SECT_NAME and SECT_SIZE.  */
+/* Iterate over core file register note sections.  */
 
-static const struct regset *
-m68kbsd_regset_from_core_section (struct gdbarch *gdbarch,
-                                 const char *sect_name, size_t sect_size)
+static void
+m68kbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
+                                     iterate_over_regset_sections_cb *cb,
+                                     void *cb_data,
+                                     const struct regcache *regcache)
 {
-  if (strcmp (sect_name, ".reg") == 0 && sect_size >= M68KBSD_SIZEOF_GREGS)
-    return &m68kbsd_gregset;
-
-  if (strcmp (sect_name, ".reg2") == 0 && sect_size >= M68KBSD_SIZEOF_FPREGS)
-    return &m68kbsd_fpregset;
-
-  return NULL;
+  cb (".reg", M68KBSD_SIZEOF_GREGS, &m68kbsd_gregset, NULL, cb_data);
+  cb (".reg2", M68KBSD_SIZEOF_FPREGS, &m68kbsd_fpregset, NULL, cb_data);
 }
 \f
 
@@ -198,8 +191,8 @@ m68kbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
   set_gdbarch_decr_pc_after_break (gdbarch, 2);
 
-  set_gdbarch_regset_from_core_section
-    (gdbarch, m68kbsd_regset_from_core_section);
+  set_gdbarch_iterate_over_regset_sections
+    (gdbarch, m68kbsd_iterate_over_regset_sections);
 }
 
 /* OpenBSD and NetBSD a.out.  */
This page took 0.02841 seconds and 4 git commands to generate.