PR gdb/18021 - defend against "static virtual" methods
[deliverable/binutils-gdb.git] / gdb / hppaobsd-tdep.c
index eece2d1752cafdce1f847b53fddeec7167a1137b..c9bc1bf7a91b1271f703bd087f2f02133ffceebb 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for OpenBSD/hppa
 
-   Copyright (C) 2004-2014 Free Software Foundation, Inc.
+   Copyright (C) 2004-2015 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -22,8 +22,6 @@
 #include "regcache.h"
 #include "regset.h"
 
-#include <string.h>
-
 #include "hppa-tdep.h"
 #include "hppabsd-tdep.h"
 
@@ -133,7 +131,9 @@ hppaobsd_supply_fpregset (const struct regset *regset,
 static const struct regset hppaobsd_gregset =
 {
   NULL,
-  hppaobsd_supply_gregset
+  hppaobsd_supply_gregset,
+  NULL,
+  REGSET_VARIABLE_SIZE
 };
 
 static const struct regset hppaobsd_fpregset =
@@ -142,20 +142,16 @@ static const struct regset hppaobsd_fpregset =
   hppaobsd_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. */
 
-static const struct regset *
-hppaobsd_regset_from_core_section (struct gdbarch *gdbarch,
-                                 const char *sect_name, size_t sect_size)
+static void
+hppaobsd_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 >= HPPAOBSD_SIZEOF_GREGS)
-    return &hppaobsd_gregset;
-
-  if (strcmp (sect_name, ".reg2") == 0 && sect_size >= HPPAOBSD_SIZEOF_FPREGS)
-    return &hppaobsd_fpregset;
-
-  return NULL;
+  cb (".reg", HPPAOBSD_SIZEOF_GREGS, &hppaobsd_gregset, NULL, cb_data);
+  cb (".reg2", HPPAOBSD_SIZEOF_FPREGS, &hppaobsd_fpregset, NULL, cb_data);
 }
 \f
 
@@ -166,8 +162,8 @@ hppaobsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   hppabsd_init_abi (info, gdbarch);
 
   /* Core file support.  */
-  set_gdbarch_regset_from_core_section
-    (gdbarch, hppaobsd_regset_from_core_section);
+  set_gdbarch_iterate_over_regset_sections
+    (gdbarch, hppaobsd_iterate_over_regset_sections);
 }
 \f
 
This page took 0.038879 seconds and 4 git commands to generate.