FRV: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections'
authorAndreas Arnez <arnez@linux.vnet.ibm.com>
Fri, 29 Nov 2013 16:31:01 +0000 (16:31 +0000)
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Tue, 30 Sep 2014 07:14:34 +0000 (09:14 +0200)
For FR-V GNU/Linux targets, no longer define the gdbarch method
'regset_from_core_section', but the iterator method instead.

gdb/ChangeLog:

* frv-linux-tdep.c (frv_linux_regset_from_core_section): Remove.
(frv_linux_iterate_over_regset_sections): New.
(frv_linux_init_abi): Adjust gdbarch initialization.

gdb/ChangeLog
gdb/frv-linux-tdep.c

index c9be5c063c5c90925fde36fd4257982fe999f5fc..28bfea5f92238c44450b3a8c032bea76e9f7c7d2 100644 (file)
@@ -1,3 +1,9 @@
+2014-09-30  Andreas Arnez  <arnez@linux.vnet.ibm.com>
+
+       * frv-linux-tdep.c (frv_linux_regset_from_core_section): Remove.
+       (frv_linux_iterate_over_regset_sections): New.
+       (frv_linux_init_abi): Adjust gdbarch initialization.
+
 2014-09-30  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
        * arm-tdep.h (armbsd_regset_from_core_section): Remove prototype.
index d9628458520617c0fdfb0f2c0a433f183d7e0056..824cf99bdfae238ee31f0ef55de8b0f17dc4fd1e 100644 (file)
@@ -443,19 +443,16 @@ static const struct regset frv_linux_fpregset =
   regcache_supply_regset, regcache_collect_regset
 };
 
-static const struct regset *
-frv_linux_regset_from_core_section (struct gdbarch *gdbarch,
-                                   const char *sect_name, size_t sect_size)
+static void
+frv_linux_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 >= sizeof (frv_elf_gregset_t))
-    return &frv_linux_gregset;
-
-  if (strcmp (sect_name, ".reg2") == 0 
-      && sect_size >= sizeof (frv_elf_fpregset_t))
-    return &frv_linux_fpregset;
-
-  return NULL;
+  cb (".reg", sizeof (frv_elf_gregset_t), &frv_linux_gregset,
+      NULL, cb_data);
+  cb (".reg2", sizeof (frv_elf_fpregset_t), &frv_linux_fpregset,
+      NULL, cb_data);
 }
 
 \f
@@ -467,8 +464,8 @@ frv_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   /* Set the sigtramp frame sniffer.  */
   frame_unwind_append_unwinder (gdbarch, &frv_linux_sigtramp_frame_unwind); 
 
-  set_gdbarch_regset_from_core_section (gdbarch,
-                                        frv_linux_regset_from_core_section);
+  set_gdbarch_iterate_over_regset_sections
+    (gdbarch, frv_linux_iterate_over_regset_sections);
 }
 
 static enum gdb_osabi