diff options
author | Andreas Arnez <arnez@linux.vnet.ibm.com> | 2013-11-29 16:57:54 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2014-09-30 09:14:37 +0200 |
commit | c6d41a6f5380624846daca4d9aad5988b3946cbd (patch) | |
tree | 2b96ea0f4a9284751f93a77ddbc6acd275e56b91 /gdb/sh-tdep.c | |
parent | 9845a0b521d8a9a117d37dbfdec56677dd7cdae8 (diff) | |
download | gdb-c6d41a6f5380624846daca4d9aad5988b3946cbd.zip gdb-c6d41a6f5380624846daca4d9aad5988b3946cbd.tar.gz gdb-c6d41a6f5380624846daca4d9aad5988b3946cbd.tar.bz2 |
SH: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections'
For Super-H targets, no longer define the gdbarch method
'regset_from_core_section', but the iterator method instead.
gdb/ChangeLog:
* sh-linux-tdep.c (sh_linux_init_abi): Set tdep fields
'sizeof_gregset' and 'sizeof_fpregset'.
* sh-tdep.c (sh_regset_from_core_section): Remove.
(sh_iterate_over_regset_sections): New.
(sh_gdbarch_init): Adjust gdbarch initialization.
* sh-tdep.h (struct gdbarch_tdep): New fields sizeof_gregset and
sizeof_fpregset.
* shnbsd-tdep.c (shnbsd_init_abi): Set tdep field
'sizeof_gregset'.
Diffstat (limited to 'gdb/sh-tdep.c')
-rw-r--r-- | gdb/sh-tdep.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index c8c36db..d91a292 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -2207,19 +2207,19 @@ static const struct regset sh_corefile_fpregset = sh_corefile_collect_regset }; -static const struct regset * -sh_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, - size_t sect_size) +static void +sh_iterate_over_regset_sections (struct gdbarch *gdbarch, + iterate_over_regset_sections_cb *cb, + void *cb_data, + const struct regcache *regcache) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - if (tdep->core_gregmap && strcmp (sect_name, ".reg") == 0) - return &sh_corefile_gregset; - - if (tdep->core_fpregmap && strcmp (sect_name, ".reg2") == 0) - return &sh_corefile_fpregset; + if (tdep->core_gregmap != NULL) + cb (".reg", tdep->sizeof_gregset, &sh_corefile_gregset, NULL, cb_data); - return NULL; + if (tdep->core_fpregmap != NULL) + cb (".reg2", tdep->sizeof_fpregset, &sh_corefile_fpregset, NULL, cb_data); } /* This is the implementation of gdbarch method @@ -2298,7 +2298,8 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) dwarf2_frame_set_init_reg (gdbarch, sh_dwarf2_frame_init_reg); - set_gdbarch_regset_from_core_section (gdbarch, sh_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, sh_iterate_over_regset_sections); switch (info.bfd_arch_info->mach) { |