From patchwork Fri Sep 12 15:39:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 2796 Received: (qmail 31751 invoked by alias); 12 Sep 2014 15:40:11 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 31532 invoked by uid 89); 12 Sep 2014 15:40:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp15.uk.ibm.com Received: from e06smtp15.uk.ibm.com (HELO e06smtp15.uk.ibm.com) (195.75.94.111) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 12 Sep 2014 15:40:07 +0000 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 12 Sep 2014 16:40:04 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 12 Sep 2014 16:40:01 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id F217A2190056 for ; Fri, 12 Sep 2014 16:39:40 +0100 (BST) Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s8CFe0Nd43581656 for ; Fri, 12 Sep 2014 15:40:00 GMT Received: from d06av06.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s8CAcPN3014933 for ; Fri, 12 Sep 2014 06:38:25 -0400 Received: from br87z6lw.boeblingen.de.ibm.com (dyn-9-152-212-196.boeblingen.de.ibm.com [9.152.212.196]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s8CAcL6n014757; Fri, 12 Sep 2014 06:38:25 -0400 From: Andreas Arnez To: gdb-patches@sourceware.org Cc: Andreas Schwab Subject: [PATCH 11/26] M68K: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' Date: Fri, 12 Sep 2014 17:39:41 +0200 Message-Id: <1410536396-25524-12-git-send-email-arnez@linux.vnet.ibm.com> In-Reply-To: <1410536396-25524-1-git-send-email-arnez@linux.vnet.ibm.com> References: <1410536396-25524-1-git-send-email-arnez@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14091215-0342-0000-0000-00000109B443 X-IsSubscribed: yes 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. --- gdb/m68kbsd-tdep.c | 24 ++++++++++-------------- gdb/m68klinux-tdep.c | 27 ++++++++++----------------- 2 files changed, 20 insertions(+), 31 deletions(-) diff --git a/gdb/m68kbsd-tdep.c b/gdb/m68kbsd-tdep.c index 6ce12b8..a329eab 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 ae2da9a..61e3cda 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,