From: Andreas Arnez Date: Sat, 29 Mar 2014 09:39:44 +0000 (+0000) Subject: M68K: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=022c98ab88317728d2f77fc1b3726bf1717dacff;p=binutils-gdb.git M68K: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' For m68k BSD and GNU/Linux targets, no longer define the gdbarch method 'regset_from_core_section', but the iterator method instead. gdb/ChangeLog: * m68kbsd-tdep.c (m68kbsd_regset_from_core_section): Remove. (m68kbsd_iterate_over_regset_sections): New. (m68kbsd_init_abi): Adjust gdbarch initialization. * m68klinux-tdep.c (m68k_linux_regset_from_core_section): Remove. (m68k_linux_iterate_over_regset_sections): New. (m68k_linux_init_abi): Adjust gdbarch initialization. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9b822b457f4..d68ecbbdb17 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2014-09-30 Andreas Arnez + + * m68kbsd-tdep.c (m68kbsd_regset_from_core_section): Remove. + (m68kbsd_iterate_over_regset_sections): New. + (m68kbsd_init_abi): Adjust gdbarch initialization. + * m68klinux-tdep.c (m68k_linux_regset_from_core_section): Remove. + (m68k_linux_iterate_over_regset_sections): New. + (m68k_linux_init_abi): Adjust gdbarch initialization. + 2014-09-30 Andreas Arnez * m32r-linux-tdep.c (M32R_LINUX_GREGS_SIZE): New macro. diff --git a/gdb/m68kbsd-tdep.c b/gdb/m68kbsd-tdep.c index 6ce12b8dd62..a329eabac92 100644 --- a/gdb/m68kbsd-tdep.c +++ b/gdb/m68kbsd-tdep.c @@ -114,20 +114,16 @@ static const struct regset m68kbsd_fpregset = m68kbsd_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 * -m68kbsd_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, size_t sect_size) +static void +m68kbsd_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 >= M68KBSD_SIZEOF_GREGS) - return &m68kbsd_gregset; - - if (strcmp (sect_name, ".reg2") == 0 && sect_size >= M68KBSD_SIZEOF_FPREGS) - return &m68kbsd_fpregset; - - return NULL; + cb (".reg", M68KBSD_SIZEOF_GREGS, &m68kbsd_gregset, NULL, cb_data); + cb (".reg2", M68KBSD_SIZEOF_FPREGS, &m68kbsd_fpregset, NULL, cb_data); } @@ -195,8 +191,8 @@ m68kbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_decr_pc_after_break (gdbarch, 2); - set_gdbarch_regset_from_core_section - (gdbarch, m68kbsd_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, m68kbsd_iterate_over_regset_sections); } /* OpenBSD and NetBSD a.out. */ diff --git a/gdb/m68klinux-tdep.c b/gdb/m68klinux-tdep.c index ae2da9abc89..61e3cdadafe 100644 --- a/gdb/m68klinux-tdep.c +++ b/gdb/m68klinux-tdep.c @@ -369,23 +369,16 @@ static const struct regset m68k_linux_fpregset = regcache_supply_regset, regcache_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 * -m68k_linux_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, - size_t sect_size) +static void +m68k_linux_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 >= M68K_LINUX_GREGS_SIZE) - return &m68k_linux_gregset; - - if (strcmp (sect_name, ".reg2") == 0 - && sect_size >= M68K_LINUX_FPREGS_SIZE) - return &m68k_linux_fpregset; - - return NULL; + cb (".reg", M68K_LINUX_GREGS_SIZE, &m68k_linux_gregset, NULL, cb_data); + cb (".reg2", M68K_LINUX_FPREGS_SIZE, &m68k_linux_fpregset, NULL, cb_data); } static void @@ -423,8 +416,8 @@ m68k_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); /* Core file support. */ - set_gdbarch_regset_from_core_section - (gdbarch, m68k_linux_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, m68k_linux_iterate_over_regset_sections); /* Enable TLS support. */ set_gdbarch_fetch_tls_load_module_address (gdbarch,