Add some more casts (1/2)
[deliverable/binutils-gdb.git] / gdb / hppanbsd-tdep.c
index 528fa540b6c6d4430a6fbb6514aca392f4909102..33ae55aafd4a9f3ea3ce3a1a5f9adc75f18e10a7 100644 (file)
@@ -1,12 +1,12 @@
 /* Target-dependent code for NetBSD/hppa
 
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008-2015 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -15,9 +15,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include "osabi.h"
@@ -27,9 +25,6 @@
 #include "trad-frame.h"
 #include "tramp-frame.h"
 
-#include "gdb_assert.h"
-#include "gdb_string.h"
-
 #include "hppa-tdep.h"
 #include "hppabsd-tdep.h"
 
@@ -166,11 +161,11 @@ static int hppanbsd_reg_offset[] =
    REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
 
 static void
-hppanbsd_supply_gregset (const struct regset *regset, struct regcache *regcache,
-                    int regnum, const void *gregs, size_t len)
+hppanbsd_supply_gregset (const struct regset *regset,
+                        struct regcache *regcache,
+                        int regnum, const void *gregs, size_t len)
 {
-  const gdb_byte *regs = gregs;
-  size_t offset;
+  const gdb_byte *regs = (const gdb_byte *) gregs;
   int i;
 
   gdb_assert (len >= HPPANBSD_SIZEOF_GREGS);
@@ -183,23 +178,21 @@ hppanbsd_supply_gregset (const struct regset *regset, struct regcache *regcache,
 
 /* NetBSD/hppa register set.  */
 
-static struct regset hppanbsd_gregset =
+static const struct regset hppanbsd_gregset =
 {
   NULL,
   hppanbsd_supply_gregset
 };
 
-/* Return the appropriate register set for the core section identified
-   by SECT_NAME and SECT_SIZE.  */
+/* Iterate over supported core file register note sections. */
 
-static const struct regset *
-hppanbsd_regset_from_core_section (struct gdbarch *gdbarch,
-                                 const char *sect_name, size_t sect_size)
+static void
+hppanbsd_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 >= HPPANBSD_SIZEOF_GREGS)
-    return &hppanbsd_gregset;
-
-  return NULL;
+  cb (".reg", HPPANBSD_SIZEOF_GREGS, &hppanbsd_gregset, NULL, cb_data);
 }
 \f
 static void
@@ -209,8 +202,8 @@ hppanbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   hppabsd_init_abi (info, gdbarch);
 
   /* Core file support.  */
-  set_gdbarch_regset_from_core_section
-    (gdbarch, hppanbsd_regset_from_core_section);
+  set_gdbarch_iterate_over_regset_sections
+    (gdbarch, hppanbsd_iterate_over_regset_sections);
 
   tramp_frame_prepend_unwinder (gdbarch, &hppanbsd_sigtramp_si4);
 }
This page took 0.029573 seconds and 4 git commands to generate.