diff options
author | Andreas Arnez <arnez@linux.vnet.ibm.com> | 2013-11-29 17:02:53 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2014-09-30 09:14:38 +0200 |
commit | e5139de88ebbfb9ce9c121e526fa507d0fa4fcea (patch) | |
tree | 48c1ef2cf9bfb8d743fb75364c49442a96a628da /gdb/sparc-tdep.c | |
parent | c6d41a6f5380624846daca4d9aad5988b3946cbd (diff) | |
download | gdb-e5139de88ebbfb9ce9c121e526fa507d0fa4fcea.zip gdb-e5139de88ebbfb9ce9c121e526fa507d0fa4fcea.tar.gz gdb-e5139de88ebbfb9ce9c121e526fa507d0fa4fcea.tar.bz2 |
SPARC: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections'
For SPARC targets, no longer define the gdbarch method
'regset_from_core_section', but the iterator method instead.
gdb/ChangeLog:
* sparc-tdep.c (sparc_regset_from_core_section): Remove.
(sparc_iterate_over_regset_sections): New.
(sparc32_gdbarch_init): Adjust gdbarch initialization.
* configure.tgt (gdb_target_obs): Add fbsd-tdep.o for SPARC FreeBSD
targets.
* sparc64fbsd-tdep.c (fbsd-tdep.h): Include.
(sparc64fbsd_init_abi): Call fbsd_init_abi.
* sparc64fbsd-nat.c (_initialize_sparc64fbsd_nat): Do not set
target method 'make_corefile_notes'.
Diffstat (limited to 'gdb/sparc-tdep.c')
-rw-r--r-- | gdb/sparc-tdep.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index bcd4f6e..7eb3b18 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -1645,22 +1645,18 @@ sparc_write_pc (struct regcache *regcache, CORE_ADDR pc) } -/* 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 * -sparc_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, size_t sect_size) +static void +sparc_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 (strcmp (sect_name, ".reg") == 0 && sect_size >= tdep->sizeof_gregset) - return tdep->gregset; - - if (strcmp (sect_name, ".reg2") == 0 && sect_size >= tdep->sizeof_fpregset) - return tdep->fpregset; - - return NULL; + cb (".reg", tdep->sizeof_gregset, tdep->gregset, NULL, cb_data); + cb (".reg2", tdep->sizeof_fpregset, tdep->fpregset, NULL, cb_data); } @@ -1740,8 +1736,8 @@ sparc32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* If we have register sets, enable the generic core file support. */ if (tdep->gregset) - set_gdbarch_regset_from_core_section (gdbarch, - sparc_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, sparc_iterate_over_regset_sections); register_sparc_ravenscar_ops (gdbarch); |