+2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
+
+ * nios2-linux-tdep.c (NIOS2_GREGS_SIZE): New macro.
+ (nios2_regset_from_core_section): Remove.
+ (nios2_iterate_over_regset_sections): New.
+ (nios2_linux_init_abi): Adjust gdbarch initialization.
+
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* mn10300-linux-tdep.c (am33_regset_from_core_section): Remove.
-1, -1, -1, -1, -1, -1, -1, -1
};
+/* General register set size. Should match sizeof (struct pt_regs) +
+ sizeof (struct switch_stack) from the NIOS2 Linux kernel patch. */
+
+#define NIOS2_GREGS_SIZE (4 * 34)
+
/* Implement the supply_regset hook for core files. */
static void
nios2_collect_gregset
};
-/* Implement the regset_from_core_section gdbarch method. */
+/* Iterate over core file register note sections. */
-static const struct regset *
-nios2_regset_from_core_section (struct gdbarch *gdbarch,
- const char *sect_name, size_t sect_size)
+static void
+nios2_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)
- return &nios2_core_regset;
-
- return NULL;
+ cb (".reg", NIOS2_GREGS_SIZE, &nios2_core_regset, NULL, cb_data);
}
/* Initialize a trad-frame cache corresponding to the tramp-frame.
set_gdbarch_fetch_tls_load_module_address (gdbarch,
svr4_fetch_objfile_link_map);
/* Core file support. */
- set_gdbarch_regset_from_core_section (gdbarch,
- nios2_regset_from_core_section);
+ set_gdbarch_iterate_over_regset_sections
+ (gdbarch, nios2_iterate_over_regset_sections);
/* Linux signal frame unwinders. */
tramp_frame_prepend_unwinder (gdbarch,
&nios2_linux_rt_sigreturn_tramp_frame);