ARM: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections'
authorAndreas Arnez <arnez@linux.vnet.ibm.com>
Sat, 29 Mar 2014 09:12:57 +0000 (09:12 +0000)
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Tue, 30 Sep 2014 07:14:34 +0000 (09:14 +0200)
For ARM BSD targets, don't define the gdbarch method
'regset_from_core_section', but the iterator method instead.

gdb/ChangeLog:

* arm-tdep.h (armbsd_regset_from_core_section): Remove prototype.
(armbsd_iterate_over_regset_sections): New prototype.
* armbsd-tdep.c (armbsd_regset_from_core_section): Remove.
(armbsd_iterate_over_regset_sections): New.
* armobsd-tdep.c (armobsd_init_abi): Adjust gdbarch
initialization.

gdb/ChangeLog
gdb/arm-tdep.h
gdb/armbsd-tdep.c
gdb/armobsd-tdep.c

index af139f18dc4ad02c487a8377fd65e9946f3cbdab..c9be5c063c5c90925fde36fd4257982fe999f5fc 100644 (file)
@@ -1,3 +1,12 @@
+2014-09-30  Andreas Arnez  <arnez@linux.vnet.ibm.com>
+
+       * arm-tdep.h (armbsd_regset_from_core_section): Remove prototype.
+       (armbsd_iterate_over_regset_sections): New prototype.
+       * armbsd-tdep.c (armbsd_regset_from_core_section): Remove.
+       (armbsd_iterate_over_regset_sections): New.
+       * armobsd-tdep.c (armobsd_init_abi): Adjust gdbarch
+       initialization.
+
 2014-09-30  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
        * alpha-linux-tdep.c (alpha_linux_regset_from_core_section): Remove.
index 29669d072114258c92b903e7c48cb82573c2f511..1d55e78ede502bdc2948302380c1daa60241ebe0 100644 (file)
@@ -341,9 +341,11 @@ extern int arm_process_record (struct gdbarch *gdbarch,
 /* Return the appropriate register set for the core section identified
    by SECT_NAME and SECT_SIZE.  */
 
-extern const struct regset *
-  armbsd_regset_from_core_section (struct gdbarch *gdbarch,
-                                  const char *sect_name, size_t sect_size);
+extern void
+  armbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
+                                      iterate_over_regset_sections_cb *cb,
+                                      void *cb_data,
+                                      const struct regcache *regcache);
 
 /* Target descriptions.  */
 extern struct target_desc *tdesc_arm_with_m;
index 62e82b8e6d8a8a9267b0b758c776b6f484895163..c4c5fd0a941edfbee935f469cde0e4428ffb4706 100644 (file)
@@ -107,18 +107,14 @@ static const struct regset armbsd_fpregset =
   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);
 }
index f4904a30930f5445f32188a67f580b4a5d9ef00c..d7bfddc1d6323a84299a696f333ad92462e9fece 100644 (file)
@@ -91,8 +91,8 @@ armobsd_init_abi (struct gdbarch_info info,
   tdep->jb_pc = 24;
   tdep->jb_elt_size = 4;
 
-  set_gdbarch_regset_from_core_section
-    (gdbarch, armbsd_regset_from_core_section);
+  set_gdbarch_iterate_over_regset_sections
+    (gdbarch, armbsd_iterate_over_regset_sections);
 
   /* OpenBSD/arm uses -fpcc-struct-return by default.  */
   tdep->struct_return = pcc_struct_return;