Make GDB wait for events after handling target File-I/O
[deliverable/binutils-gdb.git] / gdb / m68kbsd-tdep.c
index e59bc668ce761fa3849b43156b4606b40811ddc1..ff1da701cdad7e69ce24ef1b697d3634d3fca3af 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for Motorola 68000 BSD's.
 
-   Copyright (C) 2004-2014 Free Software Foundation, Inc.
+   Copyright (C) 2004-2015 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -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"
 
@@ -62,7 +59,7 @@ m68kbsd_supply_fpregset (const struct regset *regset,
                         int regnum, const void *fpregs, size_t len)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
-  const gdb_byte *regs = fpregs;
+  const gdb_byte *regs = (const gdb_byte *) fpregs;
   int i;
 
   gdb_assert (len >= M68KBSD_SIZEOF_FPREGS);
@@ -84,7 +81,7 @@ m68kbsd_supply_gregset (const struct regset *regset,
                        struct regcache *regcache,
                        int regnum, const void *gregs, size_t len)
 {
-  const gdb_byte *regs = gregs;
+  const gdb_byte *regs = (const gdb_byte *) gregs;
   int i;
 
   gdb_assert (len >= M68KBSD_SIZEOF_GREGS);
@@ -105,32 +102,30 @@ 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
+  m68kbsd_supply_gregset,
+  NULL,
+  REGSET_VARIABLE_SIZE
 };
 
-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 +193,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.024896 seconds and 4 git commands to generate.