From patchwork Fri Sep 12 15:39:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 2805 Received: (qmail 1217 invoked by alias); 12 Sep 2014 15:40:24 -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 32733 invoked by uid 89); 12 Sep 2014 15:40:17 -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: 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:14 +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:10 +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:40:08 +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 70BA81B0806B for ; Fri, 12 Sep 2014 16:41:12 +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 s8CFdxAc44695590 for ; Fri, 12 Sep 2014 15:40:07 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 s8CAcOcG014884 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 s8CAcL6k014757; Fri, 12 Sep 2014 06:38:24 -0400 From: Andreas Arnez To: gdb-patches@sourceware.org Cc: Randolph Chung Subject: [PATCH 08/26] HPPA: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' Date: Fri, 12 Sep 2014 17:39:38 +0200 Message-Id: <1410536396-25524-9-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-00000145DC27 X-IsSubscribed: yes For HP PA-RISC targets, no longer define the gdbarch method 'regset_from_core_section', but the iterator method instead. gdb/ChangeLog: * hppa-hpux-tdep.c (hppa_hpux_regset_from_core_section): Remove. (hppa_hpux_iterate_over_regset_sections): New. (hppa_hpux_init_abi): Adjust gdbarch initialization. * hppa-linux-tdep.c (hppa_linux_regset_from_core_section): Remove. (hppa_linux_iterate_over_regset_sections): New. (hppa_linux_init_abi): Adjust. * hppanbsd-tdep.c (hppaobsd_regset_from_core_section): Remove. (hppanbsd_iterate_over_regset_sections): New. (hppanbsd_init_abi): Adjust. * hppaobsd-tdep.c (hppaobsd_regset_from_core_section): Remove. (hppaobsd_iterate_over_regset_sections): New. (hppaobsd_init_abi): Adjust. --- gdb/hppa-hpux-tdep.c | 19 +++++++++---------- gdb/hppa-linux-tdep.c | 22 +++++++++++----------- gdb/hppanbsd-tdep.c | 20 +++++++++----------- gdb/hppaobsd-tdep.c | 24 ++++++++++-------------- 4 files changed, 39 insertions(+), 46 deletions(-) diff --git a/gdb/hppa-hpux-tdep.c b/gdb/hppa-hpux-tdep.c index 688ac9a..ee59811 100644 --- a/gdb/hppa-hpux-tdep.c +++ b/gdb/hppa-hpux-tdep.c @@ -1371,15 +1371,14 @@ static const struct regset hppa_hpux_regset = hppa_hpux_supply_save_state }; -static const struct regset * -hppa_hpux_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, size_t sect_size) +static void +hppa_hpux_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 >= HPPA_HPUX_PA89_SAVE_STATE_SIZE + 8) - return &hppa_hpux_regset; - - return NULL; + cb (".reg", HPPA_HPUX_PA89_SAVE_STATE_SIZE + 8, &hppa_hpux_regset, + NULL, cb_data); } @@ -1495,8 +1494,8 @@ hppa_hpux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_skip_permanent_breakpoint (gdbarch, hppa_skip_permanent_breakpoint); - set_gdbarch_regset_from_core_section - (gdbarch, hppa_hpux_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, hppa_hpux_iterate_over_regset_sections); frame_unwind_append_unwinder (gdbarch, &hppa_hpux_sigtramp_frame_unwind); } diff --git a/gdb/hppa-linux-tdep.c b/gdb/hppa-linux-tdep.c index 6bc604b..52837ee 100644 --- a/gdb/hppa-linux-tdep.c +++ b/gdb/hppa-linux-tdep.c @@ -472,17 +472,17 @@ static const struct regset hppa_linux_fpregset = regcache_supply_regset, regcache_collect_regset }; -static const struct regset * -hppa_linux_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, - size_t sect_size) +static void +hppa_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) - return &hppa_linux_regset; - else if (strcmp (sect_name, ".reg2") == 0) - return &hppa_linux_fpregset; + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - return NULL; + cb (".reg", 80 * tdep->bytes_per_address, &hppa_linux_regset, + NULL, cb_data); + cb (".reg2", 64 * 4, &hppa_linux_fpregset, NULL, cb_data); } @@ -520,8 +520,8 @@ hppa_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) more work in gcc and glibc first. */ set_gdbarch_long_double_bit (gdbarch, 64); - set_gdbarch_regset_from_core_section - (gdbarch, hppa_linux_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, hppa_linux_iterate_over_regset_sections); set_gdbarch_dwarf2_reg_to_regnum (gdbarch, hppa_dwarf_reg_to_regnum); diff --git a/gdb/hppanbsd-tdep.c b/gdb/hppanbsd-tdep.c index b3f04c7..4587466 100644 --- a/gdb/hppanbsd-tdep.c +++ b/gdb/hppanbsd-tdep.c @@ -184,17 +184,15 @@ static const struct regset hppanbsd_gregset = hppanbsd_supply_gregset }; -/* Return the appropriate register set for the core section identified - by SECT_NAME and SECT_SIZE. */ +/* Iterate over supported core file register note sections. */ -static const struct regset * -hppanbsd_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, size_t sect_size) +static void +hppanbsd_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 >= HPPANBSD_SIZEOF_GREGS) - return &hppanbsd_gregset; - - return NULL; + cb (".reg", HPPANBSD_SIZEOF_GREGS, &hppanbsd_gregset, NULL, cb_data); } static void @@ -204,8 +202,8 @@ hppanbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) hppabsd_init_abi (info, gdbarch); /* Core file support. */ - set_gdbarch_regset_from_core_section - (gdbarch, hppanbsd_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, hppanbsd_iterate_over_regset_sections); tramp_frame_prepend_unwinder (gdbarch, &hppanbsd_sigtramp_si4); } diff --git a/gdb/hppaobsd-tdep.c b/gdb/hppaobsd-tdep.c index c521359..3d2f217 100644 --- a/gdb/hppaobsd-tdep.c +++ b/gdb/hppaobsd-tdep.c @@ -140,20 +140,16 @@ static const struct regset hppaobsd_fpregset = hppaobsd_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. */ -static const struct regset * -hppaobsd_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, size_t sect_size) +static void +hppaobsd_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 >= HPPAOBSD_SIZEOF_GREGS) - return &hppaobsd_gregset; - - if (strcmp (sect_name, ".reg2") == 0 && sect_size >= HPPAOBSD_SIZEOF_FPREGS) - return &hppaobsd_fpregset; - - return NULL; + cb (".reg", HPPAOBSD_SIZEOF_GREGS, &hppaobsd_gregset, NULL, cb_data); + cb (".reg2", HPPAOBSD_SIZEOF_FPREGS, &hppaobsd_fpregset, NULL, cb_data); } @@ -164,8 +160,8 @@ hppaobsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) hppabsd_init_abi (info, gdbarch); /* Core file support. */ - set_gdbarch_regset_from_core_section - (gdbarch, hppaobsd_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, hppaobsd_iterate_over_regset_sections); }