From patchwork Fri Sep 12 15:39:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 2795 Received: (qmail 31654 invoked by alias); 12 Sep 2014 15:40:10 -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 31508 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: e06smtp14.uk.ibm.com Received: from e06smtp14.uk.ibm.com (HELO e06smtp14.uk.ibm.com) (195.75.94.110) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 12 Sep 2014 15:40:08 +0000 Received: from /spool/local by e06smtp14.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 d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 12 Sep 2014 16:40:02 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 4440D17D8047 for ; Fri, 12 Sep 2014 16:42:04 +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 s8CFe2b648890040 for ; Fri, 12 Sep 2014 15:40:02 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 s8CAcRrM015062 for ; Fri, 12 Sep 2014 06:38:27 -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 s8CAcL6x014757; Fri, 12 Sep 2014 06:38:27 -0400 From: Andreas Arnez To: gdb-patches@sourceware.org Cc: Jiong Wang Subject: [PATCH 21/26] TILEGX: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' Date: Fri, 12 Sep 2014 17:39:51 +0200 Message-Id: <1410536396-25524-22-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-1948-0000-0000-00000118F046 X-IsSubscribed: yes For TILE-Gx GNU/Linux targets, no longer define the gdbarch method 'regset_from_core_section', but the iterator method instead. gdb/ChangeLog: * tilegx-linux-tdep.c (TILEGX_LINUX_SIZEOF_GREGSET): New macro. (tilegx_regset_from_core_section): Remove. (tilegx_iterate_over_regset_sections): New. (tilegx_linux_init_abi): Adjust gdbarch initialization. --- gdb/tilegx-linux-tdep.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/gdb/tilegx-linux-tdep.c b/gdb/tilegx-linux-tdep.c index 184d00c..829a09b 100644 --- a/gdb/tilegx-linux-tdep.c +++ b/gdb/tilegx-linux-tdep.c @@ -83,6 +83,8 @@ static const struct regcache_map_entry tilegx_linux_regmap[] = { 0 } }; +#define TILEGX_LINUX_SIZEOF_GREGSET (64 * 8) + /* TILE-Gx Linux kernel register set. */ static const struct regset tilegx_linux_regset = @@ -91,15 +93,15 @@ static const struct regset tilegx_linux_regset = regcache_supply_regset, regcache_collect_regset }; -static const struct regset * -tilegx_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, - size_t sect_size) -{ - if (strcmp (sect_name, ".reg") == 0) - return &tilegx_linux_regset; - return NULL; +static void +tilegx_iterate_over_regset_sections (struct gdbarch *gdbarch, + iterate_over_regset_sections_cb *cb, + void *cb_data, + const struct regcache *regcache) +{ + cb (".reg", TILEGX_LINUX_SIZEOF_GREGSET, &tilegx_linux_regset, + NULL, cb_data); } /* OS specific initialization of gdbarch. */ @@ -113,8 +115,8 @@ tilegx_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) tramp_frame_prepend_unwinder (gdbarch, &tilegx_linux_rt_sigframe); - set_gdbarch_regset_from_core_section (gdbarch, - tilegx_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, tilegx_iterate_over_regset_sections); /* GNU/Linux uses SVR4-style shared libraries. */ if (arch_size == 32)