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.
This commit is contained in:
Andreas Arnez
2014-09-10 08:42:07 +00:00
committed by Andreas Krebbel
parent c5b8d704bc
commit 23ea9aebce
7 changed files with 69 additions and 61 deletions

View File

@ -147,25 +147,18 @@ static const struct regset rs6000_aix64_regset =
rs6000_aix_collect_regset,
};
/* 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 *
rs6000_aix_regset_from_core_section (struct gdbarch *gdbarch,
const char *sect_name, size_t sect_size)
static void
rs6000_aix_iterate_over_regset_sections (struct gdbarch *gdbarch,
iterate_over_regset_sections_cb *cb,
void *cb_data,
const struct regcache *regcache)
{
if (gdbarch_tdep (gdbarch)->wordsize == 4)
{
if (strcmp (sect_name, ".reg") == 0 && sect_size >= 592)
return &rs6000_aix32_regset;
}
cb (".reg", 592, &rs6000_aix32_regset, NULL, cb_data);
else
{
if (strcmp (sect_name, ".reg") == 0 && sect_size >= 576)
return &rs6000_aix64_regset;
}
return NULL;
cb (".reg", 576, &rs6000_aix64_regset, NULL, cb_data);
}
@ -1065,8 +1058,8 @@ rs6000_aix_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch)
(gdbarch, rs6000_convert_from_func_ptr_addr);
/* Core file support. */
set_gdbarch_regset_from_core_section
(gdbarch, rs6000_aix_regset_from_core_section);
set_gdbarch_iterate_over_regset_sections
(gdbarch, rs6000_aix_iterate_over_regset_sections);
set_gdbarch_core_xfer_shared_libraries_aix
(gdbarch, rs6000_aix_core_xfer_shared_libraries_aix);