Warn if core file register section is larger than expected
[deliverable/binutils-gdb.git] / gdb / hppa-hpux-tdep.c
index 688ac9a8cd2ebabcacc3c023c2afa26991ccf75c..3c0f3909fdc5f46417b16ddac0bca3b2fb873a97 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for HP-UX on PA-RISC.
 
-   Copyright (C) 2002-2014 Free Software Foundation, Inc.
+   Copyright (C) 2002-2015 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -34,7 +34,6 @@
 #include "solib-pa64.h"
 #include "regset.h"
 #include "regcache.h"
-#include "exceptions.h"
 
 #define IS_32BIT_TARGET(_gdbarch) \
        ((gdbarch_tdep (_gdbarch))->bytes_per_address == 4)
@@ -1368,18 +1367,19 @@ hppa_hpux_supply_save_state (const struct regset *regset,
 static const struct regset hppa_hpux_regset =
 {
   NULL,
-  hppa_hpux_supply_save_state
+  hppa_hpux_supply_save_state,
+  NULL,
+  REGSET_VARIABLE_SIZE
 };
 
-static const struct regset *
-hppa_hpux_regset_from_core_section (struct gdbarch *gdbarch,
-                                   const char *sect_name, size_t sect_size)
+static void
+hppa_hpux_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 >= HPPA_HPUX_PA89_SAVE_STATE_SIZE + 8)
-    return &hppa_hpux_regset;
-
-  return NULL;
+  cb (".reg", HPPA_HPUX_PA89_SAVE_STATE_SIZE + 8, &hppa_hpux_regset,
+      NULL, cb_data);
 }
 \f
 
@@ -1495,8 +1495,8 @@ hppa_hpux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_skip_permanent_breakpoint
     (gdbarch, hppa_skip_permanent_breakpoint);
 
-  set_gdbarch_regset_from_core_section
-    (gdbarch, hppa_hpux_regset_from_core_section);
+  set_gdbarch_iterate_over_regset_sections
+    (gdbarch, hppa_hpux_iterate_over_regset_sections);
 
   frame_unwind_append_unwinder (gdbarch, &hppa_hpux_sigtramp_frame_unwind);
 }
This page took 0.024267 seconds and 4 git commands to generate.