From 970940347aef2ad1737d76cfabc12f6c9ca2ba89 Mon Sep 17 00:00:00 2001 From: Andreas Arnez Date: Fri, 29 Nov 2013 17:06:22 +0000 Subject: [PATCH] XTENSA: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' For Xtensa targets, no longer define the gdbarch method 'regset_from_core_section', but the iterator method instead. gdb/ChangeLog: * xtensa-tdep.c (xtensa_regset_from_core_section): Remove. (xtensa_iterate_over_regset_sections): New. (xtensa_gdbarch_init): Adjust gdbarch initialization. --- gdb/ChangeLog | 6 ++++++ gdb/xtensa-tdep.c | 27 +++++++++++---------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a743020f4d4..b8a2ff9470e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2014-09-30 Andreas Arnez + + * xtensa-tdep.c (xtensa_regset_from_core_section): Remove. + (xtensa_iterate_over_regset_sections): New. + (xtensa_gdbarch_init): Adjust gdbarch initialization. + 2014-09-30 Andreas Arnez * vax-tdep.c (vax_regset_from_core_section): Remove. diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c index 24ec5f01cbb..dcdaa831fa2 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -910,23 +910,18 @@ xtensa_gregset = }; -/* 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 * -xtensa_regset_from_core_section (struct gdbarch *core_arch, - const char *sect_name, - size_t sect_size) +static void +xtensa_iterate_over_regset_sections (struct gdbarch *gdbarch, + iterate_over_regset_sections_cb *cb, + void *cb_data, + const struct regcache *regcache) { - DEBUGTRACE ("xtensa_regset_from_core_section " - "(..., sect_name==\"%s\", sect_size==%x)\n", - sect_name, (unsigned int) sect_size); + DEBUGTRACE ("xtensa_iterate_over_regset_sections\n"); - if (strcmp (sect_name, ".reg") == 0 - && sect_size >= sizeof(xtensa_elf_gregset_t)) - return &xtensa_gregset; - - return NULL; + cb (".reg", sizeof (xtensa_elf_gregset_t), &xtensa_gregset, + NULL, cb_data); } @@ -3280,8 +3275,8 @@ xtensa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) xtensa_add_reggroups (gdbarch); set_gdbarch_register_reggroup_p (gdbarch, xtensa_register_reggroup_p); - set_gdbarch_regset_from_core_section (gdbarch, - xtensa_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, xtensa_iterate_over_regset_sections); set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets);