From patchwork Fri Sep 12 15:39:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 2790 Received: (qmail 31161 invoked by alias); 12 Sep 2014 15:40:07 -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 31044 invoked by uid 89); 12 Sep 2014 15:40:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp11.uk.ibm.com Received: from e06smtp11.uk.ibm.com (HELO e06smtp11.uk.ibm.com) (195.75.94.107) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 12 Sep 2014 15:40:05 +0000 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 12 Sep 2014 16:40:02 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 12 Sep 2014 16:39:59 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id C13861B0805F for ; Fri, 12 Sep 2014 16:41:03 +0100 (BST) Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s8CFdxWm20119722 for ; Fri, 12 Sep 2014 15:39:59 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 s8CAcOuI014857 for ; Fri, 12 Sep 2014 06:38:24 -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 s8CAcL6i014757; Fri, 12 Sep 2014 06:38:23 -0400 From: Andreas Arnez To: gdb-patches@sourceware.org Cc: Richard Earnshaw Subject: [PATCH 06/26] ARM: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' Date: Fri, 12 Sep 2014 17:39:36 +0200 Message-Id: <1410536396-25524-7-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-5024-0000-0000-00000145DC08 X-IsSubscribed: yes For ARM BSD targets, don't define the gdbarch method 'regset_from_core_section', but the iterator method instead. gdb/ChangeLog: * arm-tdep.h (armbsd_regset_from_core_section): Remove prototype. (armbsd_iterate_over_regset_sections): New prototype. * armbsd-tdep.c (armbsd_regset_from_core_section): Remove. (armbsd_iterate_over_regset_sections): New. * armobsd-tdep.c (armobsd_init_abi): Adjust gdbarch initialization. --- gdb/arm-tdep.h | 8 +++++--- gdb/armbsd-tdep.c | 20 ++++++++------------ gdb/armobsd-tdep.c | 4 ++-- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/gdb/arm-tdep.h b/gdb/arm-tdep.h index 29669d0..1d55e78 100644 --- a/gdb/arm-tdep.h +++ b/gdb/arm-tdep.h @@ -341,9 +341,11 @@ extern int arm_process_record (struct gdbarch *gdbarch, /* Return the appropriate register set for the core section identified by SECT_NAME and SECT_SIZE. */ -extern const struct regset * - armbsd_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, size_t sect_size); +extern void + armbsd_iterate_over_regset_sections (struct gdbarch *gdbarch, + iterate_over_regset_sections_cb *cb, + void *cb_data, + const struct regcache *regcache); /* Target descriptions. */ extern struct target_desc *tdesc_arm_with_m; diff --git a/gdb/armbsd-tdep.c b/gdb/armbsd-tdep.c index 62e82b8..c4c5fd0 100644 --- a/gdb/armbsd-tdep.c +++ b/gdb/armbsd-tdep.c @@ -107,18 +107,14 @@ static const struct regset armbsd_fpregset = armbsd_supply_fpregset }; -/* Return the appropriate register set for the core section identified - by SECT_NAME and SECT_SIZE. */ +/* Iterate over supported core file register note sections. */ -const struct regset * -armbsd_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, size_t sect_size) +void +armbsd_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 >= ARMBSD_SIZEOF_GREGS) - return &armbsd_gregset; - - if (strcmp (sect_name, ".reg2") == 0 && sect_size >= ARMBSD_SIZEOF_FPREGS) - return &armbsd_fpregset; - - return NULL; + cb (".reg", ARMBSD_SIZEOF_GREGS, &armbsd_gregset, NULL, cb_data); + cb (".reg2", ARMBSD_SIZEOF_FPREGS, &armbsd_fpregset, NULL, cb_data); } diff --git a/gdb/armobsd-tdep.c b/gdb/armobsd-tdep.c index f4904a3..d7bfddc 100644 --- a/gdb/armobsd-tdep.c +++ b/gdb/armobsd-tdep.c @@ -91,8 +91,8 @@ armobsd_init_abi (struct gdbarch_info info, tdep->jb_pc = 24; tdep->jb_elt_size = 4; - set_gdbarch_regset_from_core_section - (gdbarch, armbsd_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, armbsd_iterate_over_regset_sections); /* OpenBSD/arm uses -fpcc-struct-return by default. */ tdep->struct_return = pcc_struct_return;