From 23ea9aebceb83a7b0e00da62de37d592ba51b616 Mon Sep 17 00:00:00 2001 From: Andreas Arnez Date: Wed, 10 Sep 2014 08:42:07 +0000 Subject: PPC: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' For PPC targets, no longer define the gdbarch method 'regset_from_core_section', but the iterator method instead. gdb/ChangeLog: * configure.tgt (gdb_target_obs): Add fbsd-tdep.o for PowerPC FreeBSD targets. * ppcfbsd-nat.c (_initialize_ppcfbsd_nat): Do not set target method 'make_corefile_notes'. * ppcfbsd-tdep.c (fbsd-tdep.h): Include. (ppcfbsd_regset_from_core_section): Remove. (ppcfbsd_iterate_over_regset_sections): New. (ppcfbsd_init_abi): Call fbsd_init_abi. Adjust gdbarch initialization. * ppcnbsd-tdep.c (ppcnbsd_regset_from_core_section): Remove. (ppcnbsd_iterate_over_regset_sections): New. (ppcnbsd_init_abi): Adjust. * ppcobsd-tdep.c (ppcobsd_regset_from_core_section): Remove. (ppcobsd_iterate_over_regset_sections): New. (ppcobsd_init_abi): Adjust. * rs6000-aix-tdep.c (rs6000_aix_regset_from_core_section): Remove. (rs6000_aix_iterate_over_regset_sections): New. (rs6000_aix_init_osabi): Adjust. --- gdb/ppcnbsd-tdep.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'gdb/ppcnbsd-tdep.c') diff --git a/gdb/ppcnbsd-tdep.c b/gdb/ppcnbsd-tdep.c index a5c1e3d..0028e51 100644 --- a/gdb/ppcnbsd-tdep.c +++ b/gdb/ppcnbsd-tdep.c @@ -51,20 +51,16 @@ const struct regset ppcnbsd_fpregset = ppc_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 * -ppcnbsd_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, size_t sect_size) +static void +ppcnbsd_iterate_over_regset_sections (struct gdbarch *gdbarch, + iterate_over_regset_sections_cb *cb, + void *cb_data, + const struct regcache *regcache) { - if (strcmp (sect_name, ".reg") == 0 && sect_size >= 148) - return &ppcnbsd_gregset; - - if (strcmp (sect_name, ".reg2") == 0 && sect_size >= 264) - return &ppcnbsd_fpregset; - - return NULL; + cb (".reg", 148, &ppcnbsd_gregset, NULL, cb_data); + cb (".reg2", 264, &ppcnbsd_fpregset, NULL, cb_data); } @@ -185,8 +181,8 @@ ppcnbsd_init_abi (struct gdbarch_info info, set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); - set_gdbarch_regset_from_core_section - (gdbarch, ppcnbsd_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, ppcnbsd_iterate_over_regset_sections); tramp_frame_prepend_unwinder (gdbarch, &ppcnbsd_sigtramp); tramp_frame_prepend_unwinder (gdbarch, &ppcnbsd2_sigtramp); -- cgit v1.1