Add some more casts (1/2)
[deliverable/binutils-gdb.git] / gdb / armbsd-tdep.c
index b2e12baac365fc781980d5d578352cba408d2479..1b9bad7896918b49880c6a4f425d11e72410affc 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for ARM BSD's.
 
-   Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2006-2015 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -22,9 +22,6 @@
 #include "regcache.h"
 #include "regset.h"
 
-#include "gdb_assert.h"
-#include "gdb_string.h"
-
 #include "arm-tdep.h"
 
 /* Core file support.  */
@@ -53,7 +50,7 @@ armbsd_supply_fpregset (const struct regset *regset,
                        struct regcache *regcache,
                        int regnum, const void *fpregs, size_t len)
 {
-  const gdb_byte *regs = fpregs;
+  const gdb_byte *regs = (const gdb_byte *) fpregs;
   int i;
 
   gdb_assert (len >= ARMBSD_SIZEOF_FPREGS);
@@ -74,7 +71,7 @@ armbsd_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 >= ARMBSD_SIZEOF_GREGS);
@@ -98,30 +95,28 @@ armbsd_supply_gregset (const struct regset *regset,
 
 /* ARM register sets.  */
 
-static struct regset armbsd_gregset =
+static const struct regset armbsd_gregset =
 {
   NULL,
-  armbsd_supply_gregset
+  armbsd_supply_gregset,
+  NULL,
+  REGSET_VARIABLE_SIZE
 };
 
-static struct regset armbsd_fpregset =
+static const struct regset armbsd_fpregset =
 {
   NULL,
   armbsd_supply_fpregset
 };
 
-/* Return the appropriate register set for the core section identified
-   by SECT_NAME and SECT_SIZE.  */
+/* Iterate over supported core file register note sections. */
 
-const struct regset *
-armbsd_regset_from_core_section (struct gdbarch *gdbarch,
-                                const char *sect_name, size_t sect_size)
+void
+armbsd_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 >= ARMBSD_SIZEOF_GREGS)
-    return &armbsd_gregset;
-
-  if (strcmp (sect_name, ".reg2") == 0 && sect_size >= ARMBSD_SIZEOF_FPREGS)
-    return &armbsd_fpregset;
-
-  return NULL;
+  cb (".reg", ARMBSD_SIZEOF_GREGS, &armbsd_gregset, NULL, cb_data);
+  cb (".reg2", ARMBSD_SIZEOF_FPREGS, &armbsd_fpregset, NULL, cb_data);
 }
This page took 0.026486 seconds and 4 git commands to generate.