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/mipsnbsd-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/mipsnbsd-tdep.c')
-rw-r--r-- | gdb/mipsnbsd-tdep.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/gdb/mipsnbsd-tdep.c b/gdb/mipsnbsd-tdep.c index f8aa210..926e7d9 100644 --- a/gdb/mipsnbsd-tdep.c +++ b/gdb/mipsnbsd-tdep.c @@ -112,24 +112,20 @@ static const struct regset mipsnbsd_fpregset = mipsnbsd_supply_fpregset }; -/* Return the appropriate register set for the core section identified - by SECT_NAME and SECT_SIZE. */ +/* Iterate over core file register note sections. */ -static const struct regset * -mipsnbsd_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, size_t sect_size) +static void +mipsnbsd_iterate_over_regset_sections (struct gdbarch *gdbarch, + iterate_over_regset_sections_cb *cb, + void *cb_data, + const struct regcache *regcache) { size_t regsize = mips_isa_regsize (gdbarch); - - if (strcmp (sect_name, ".reg") == 0 - && sect_size >= MIPSNBSD_NUM_GREGS * regsize) - return &mipsnbsd_gregset; - - if (strcmp (sect_name, ".reg2") == 0 - && sect_size >= MIPSNBSD_NUM_FPREGS * regsize) - return &mipsnbsd_fpregset; - return NULL; + cb (".reg", MIPSNBSD_NUM_GREGS * regsize, &mipsnbsd_gregset, + NULL, cb_data); + cb (".reg2", MIPSNBSD_NUM_FPREGS * regsize, &mipsnbsd_fpregset, + NULL, cb_data); } @@ -358,8 +354,8 @@ static void mipsnbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { - set_gdbarch_regset_from_core_section - (gdbarch, mipsnbsd_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, mipsnbsd_iterate_over_regset_sections); set_gdbarch_get_longjmp_target (gdbarch, mipsnbsd_get_longjmp_target); |