diff options
author | Andreas Arnez <arnez@linux.vnet.ibm.com> | 2013-11-29 16:49:03 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2014-09-30 09:14:36 +0200 |
commit | d40362355c4db0a32381a2c44e0761030a5197de (patch) | |
tree | 9470160e4b5e2c33156d01f9d42e01843d052907 /gdb/mips-linux-tdep.c | |
parent | b61ddd6e2452974afa3fb8ecaf3dea74d47a0b5e (diff) | |
download | gdb-d40362355c4db0a32381a2c44e0761030a5197de.zip gdb-d40362355c4db0a32381a2c44e0761030a5197de.tar.gz gdb-d40362355c4db0a32381a2c44e0761030a5197de.tar.bz2 |
MIPS: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections'
For MIPS targets, no longer define the gdbarch method
'regset_from_core_section', but the iterator method instead.
gdb/ChangeLog:
* mips-linux-tdep.c (mips_linux_regset_from_core_section): Remove.
(mips_linux_iterate_over_regset_sections): New.
(mips_linux_init_abi): Adjust gdbarch initialization.
* mips64obsd-tdep.c (mips64obsd_regset_from_core_section): Remove.
(mips64obsd_iterate_over_regset_sections): New.
(mips64obsd_init_abi): Adjust.
* mipsnbsd-tdep.c (mipsnbsd_regset_from_core_section): Remove.
(mipsnbsd_iterate_over_regset_sections): New.
(mipsnbsd_init_abi): Adjust.
Diffstat (limited to 'gdb/mips-linux-tdep.c')
-rw-r--r-- | gdb/mips-linux-tdep.c | 47 |
1 files changed, 17 insertions, 30 deletions
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c index 5639870..c2cec3d 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -636,39 +636,26 @@ static const struct regset mips64_linux_fpregset = NULL, mips64_supply_fpregset_wrapper, mips64_fill_fpregset_wrapper }; -static const struct regset * -mips_linux_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, size_t sect_size) +static void +mips_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, + iterate_over_regset_sections_cb *cb, + void *cb_data, + const struct regcache *regcache) { - mips_elf_gregset_t gregset; - mips_elf_fpregset_t fpregset; - mips64_elf_gregset_t gregset64; - mips64_elf_fpregset_t fpregset64; - - if (strcmp (sect_name, ".reg") == 0) + if (register_size (gdbarch, MIPS_ZERO_REGNUM) == 4) { - if (sect_size == sizeof (gregset)) - return &mips_linux_gregset; - else if (sect_size == sizeof (gregset64)) - return &mips64_linux_gregset; - else - { - warning (_("wrong size gregset struct in core file")); - } + cb (".reg", sizeof (mips_elf_gregset_t), &mips_linux_gregset, + NULL, cb_data); + cb (".reg2", sizeof (mips_elf_fpregset_t), &mips_linux_fpregset, + NULL, cb_data); } - else if (strcmp (sect_name, ".reg2") == 0) + else { - if (sect_size == sizeof (fpregset)) - return &mips_linux_fpregset; - else if (sect_size == sizeof (fpregset64)) - return &mips64_linux_fpregset; - else - { - warning (_("wrong size fpregset struct in core file")); - } + cb (".reg", sizeof (mips64_elf_gregset_t), &mips64_linux_gregset, + NULL, cb_data); + cb (".reg2", sizeof (mips64_elf_fpregset_t), &mips64_linux_fpregset, + NULL, cb_data); } - - return NULL; } static const struct target_desc * @@ -1628,8 +1615,8 @@ mips_linux_init_abi (struct gdbarch_info info, set_gdbarch_core_read_description (gdbarch, mips_linux_core_read_description); - set_gdbarch_regset_from_core_section (gdbarch, - mips_linux_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, mips_linux_iterate_over_regset_sections); set_gdbarch_gdb_signal_from_target (gdbarch, mips_gdb_signal_from_target); |