From patchwork Fri Sep 12 15:39:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 2819 Received: (qmail 15603 invoked by alias); 12 Sep 2014 18:31:55 -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 15593 invoked by uid 89); 12 Sep 2014 18:31:54 -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: e06smtp12.uk.ibm.com Received: from e06smtp12.uk.ibm.com (HELO e06smtp12.uk.ibm.com) (195.75.94.108) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 12 Sep 2014 18:31:54 +0000 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 12 Sep 2014 19:31:49 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 12 Sep 2014 16:40:01 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 46BC317D8059 for ; Fri, 12 Sep 2014 16:42:03 +0100 (BST) Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s8CFe1gH41222230 for ; Fri, 12 Sep 2014 15:40:01 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 s8CAcQUj014982 for ; Fri, 12 Sep 2014 06:38:26 -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 s8CAcL6r014757; Fri, 12 Sep 2014 06:38:26 -0400 From: Andreas Arnez To: gdb-patches@sourceware.org Cc: Kevin Buettner Subject: [PATCH 15/26] MN10300: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections'. Date: Fri, 12 Sep 2014 17:39:45 +0200 Message-Id: <1410536396-25524-16-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-8372-0000-0000-00000127461F X-IsSubscribed: yes For MN10300 GNU/Linux targets, no longer define the gdbarch method 'regset_from_core_section', but the iterator method instead. gdb/ChangeLog: * mn10300-linux-tdep.c (am33_regset_from_core_section): Remove. (am33_iterate_over_regset_sections): New. (am33_linux_init_osabi): Adjust gdbarch initialization. --- gdb/mn10300-linux-tdep.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/gdb/mn10300-linux-tdep.c b/gdb/mn10300-linux-tdep.c index 023c61d..9e6844d 100644 --- a/gdb/mn10300-linux-tdep.c +++ b/gdb/mn10300-linux-tdep.c @@ -457,17 +457,18 @@ static const struct regset am33_fpregset = NULL, am33_supply_fpregset_method, am33_collect_fpregset_method }; -/* Create a struct regset from a corefile register section. */ +/* Iterate over core file register note sections. */ -static const struct regset * -am33_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, - size_t sect_size) +static void +am33_iterate_over_regset_sections (struct gdbarch *gdbarch, + iterate_over_regset_sections_cb *cb, + void *cb_data, + const struct regcache *regcache) { - if (sect_size == sizeof (mn10300_elf_fpregset_t)) - return &am33_fpregset; - else - return &am33_gregset; + cb (".reg", sizeof (mn10300_elf_gregset_t), &am33_gregset, + NULL, cb_data); + cb (".reg2", sizeof(mn10300_elf_fpregset_t), &am33_fpregset, + NULL, cb_data); } static void @@ -714,8 +715,8 @@ am33_linux_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch) { linux_init_abi (info, gdbarch); - set_gdbarch_regset_from_core_section (gdbarch, - am33_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, am33_iterate_over_regset_sections); set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets);