X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gdb%2Fsh-tdep.c;h=d91a29217c7461b4d3fe569b14b98d0f9395ce92;hb=fab39d55fa914ad1cea809848899c76c64eaab9d;hp=85f8067acd5376f8939808f8b0fc4ca079e03290;hpb=41bf6acad7b02f67240f4cf84f066078f9ed7116;p=platform%2Fupstream%2Fbinutils.git diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 85f8067..d91a292 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -32,8 +32,6 @@ #include "value.h" #include "dis-asm.h" #include "inferior.h" -#include -#include "gdb_assert.h" #include "arch-utils.h" #include "floatformat.h" #include "regcache.h" @@ -2195,33 +2193,33 @@ sh_corefile_collect_regset (const struct regset *regset, /* The following two regsets have the same contents, so it is tempting to unify them, but they are distiguished by their address, so don't. */ -struct regset sh_corefile_gregset = +const struct regset sh_corefile_gregset = { NULL, sh_corefile_supply_regset, sh_corefile_collect_regset }; -static struct regset sh_corefile_fpregset = +static const struct regset sh_corefile_fpregset = { NULL, sh_corefile_supply_regset, 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 @@ -2300,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) {