From patchwork Fri Sep 12 15:39:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 2800 Received: (qmail 32063 invoked by alias); 12 Sep 2014 15:40:13 -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 31884 invoked by uid 89); 12 Sep 2014 15:40:12 -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: e06smtp13.uk.ibm.com Received: from e06smtp13.uk.ibm.com (HELO e06smtp13.uk.ibm.com) (195.75.94.109) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 12 Sep 2014 15:40:09 +0000 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 12 Sep 2014 16:40:05 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 12 Sep 2014 16:40:03 +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 DC99517D8045 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 b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s8CFe20A47054918 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 s8CAcRvb015104 for ; Fri, 12 Sep 2014 06:38:28 -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 s8CAcL74014757 for ; Fri, 12 Sep 2014 06:38:27 -0400 From: Andreas Arnez To: gdb-patches@sourceware.org Subject: [PATCH 26/26] Drop 'regset_from_core_section' gdbarch method Date: Fri, 12 Sep 2014 17:39:56 +0200 Message-Id: <1410536396-25524-27-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-2966-0000-0000-0000011D0BDD X-IsSubscribed: yes Now that all instances of the regset_from_core_section gdbarch method have been replaced by the new iterator method, delete the obsolete method from the gdbarch interface. Adjust all invocations and references to it. gdb/ChangeLog: * gdbarch.sh (regset_from_core_section): Remove gdbarch method. * gdbarch.c: Regenerate. * gdbarch.h: Likewise. * corelow.c (sniff_core_bfd): Drop presence check for deleted gdbarch method 'regset_from_core_section'. (get_core_register_section): Remove handling for the case that regset == NULL and regset_from_core_section is defined. (get_core_registers): Drop check for deleted method. * procfs.c (procfs_do_thread_registers): Adjust comment. --- gdb/corelow.c | 22 ++-------------------- gdb/gdbarch.c | 32 -------------------------------- gdb/gdbarch.h | 9 --------- gdb/gdbarch.sh | 4 ---- gdb/procfs.c | 2 +- 5 files changed, 3 insertions(+), 66 deletions(-) diff --git a/gdb/corelow.c b/gdb/corelow.c index 42af7f4..30d3367 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -134,9 +134,7 @@ sniff_core_bfd (bfd *abfd) /* Don't sniff if we have support for register sets in CORE_GDBARCH. */ - if (core_gdbarch - && (gdbarch_iterate_over_regset_sections_p (core_gdbarch) - || gdbarch_regset_from_core_section_p (core_gdbarch))) + if (core_gdbarch && gdbarch_iterate_over_regset_sections_p (core_gdbarch)) return NULL; for (cf = core_file_fns; cf != NULL; cf = cf->next) @@ -536,20 +534,6 @@ get_core_register_section (struct regcache *regcache, return; } - if (regset == NULL - && core_gdbarch && gdbarch_regset_from_core_section_p (core_gdbarch)) - { - regset = gdbarch_regset_from_core_section (core_gdbarch, - name, size); - if (regset == NULL) - { - if (required) - warning (_("Couldn't recognize %s registers in core file."), - human_name); - return; - } - } - if (regset != NULL) { regset->supply_regset (regset, regcache, -1, contents, size); @@ -605,9 +589,7 @@ get_core_registers (struct target_ops *ops, int i; struct gdbarch *gdbarch; - if (!(core_gdbarch - && (gdbarch_iterate_over_regset_sections_p (core_gdbarch) - || gdbarch_regset_from_core_section_p (core_gdbarch))) + if (!(core_gdbarch && gdbarch_iterate_over_regset_sections_p (core_gdbarch)) && (core_vec == NULL || core_vec->core_read_registers == NULL)) { fprintf_filtered (gdb_stderr, diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index be4bb78..e96d651 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -259,7 +259,6 @@ struct gdbarch gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags; gdbarch_register_reggroup_p_ftype *register_reggroup_p; gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument; - gdbarch_regset_from_core_section_ftype *regset_from_core_section; gdbarch_iterate_over_regset_sections_ftype *iterate_over_regset_sections; gdbarch_make_corefile_notes_ftype *make_corefile_notes; gdbarch_elfcore_write_linux_prpsinfo_ftype *elfcore_write_linux_prpsinfo; @@ -570,7 +569,6 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of address_class_name_to_type_flags, has predicate. */ /* Skip verify of register_reggroup_p, invalid_p == 0 */ /* Skip verify of fetch_pointer_argument, has predicate. */ - /* Skip verify of regset_from_core_section, has predicate. */ /* Skip verify of iterate_over_regset_sections, has predicate. */ /* Skip verify of make_corefile_notes, has predicate. */ /* Skip verify of elfcore_write_linux_prpsinfo, has predicate. */ @@ -1144,12 +1142,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: register_type = <%s>\n", host_address_to_string (gdbarch->register_type)); fprintf_unfiltered (file, - "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n", - gdbarch_regset_from_core_section_p (gdbarch)); - fprintf_unfiltered (file, - "gdbarch_dump: regset_from_core_section = <%s>\n", - host_address_to_string (gdbarch->regset_from_core_section)); - fprintf_unfiltered (file, "gdbarch_dump: gdbarch_relocate_instruction_p() = %d\n", gdbarch_relocate_instruction_p (gdbarch)); fprintf_unfiltered (file, @@ -3241,30 +3233,6 @@ set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, } int -gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - return gdbarch->regset_from_core_section != NULL; -} - -const struct regset * -gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size) -{ - gdb_assert (gdbarch != NULL); - gdb_assert (gdbarch->regset_from_core_section != NULL); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n"); - return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size); -} - -void -set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch, - gdbarch_regset_from_core_section_ftype regset_from_core_section) -{ - gdbarch->regset_from_core_section = regset_from_core_section; -} - -int gdbarch_iterate_over_regset_sections_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 90a63ca..6e84004 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -736,15 +736,6 @@ typedef CORE_ADDR (gdbarch_fetch_pointer_argument_ftype) (struct frame_info *fra extern CORE_ADDR gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type); extern void set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument); -/* Return the appropriate register set for a core file section with - name SECT_NAME and size SECT_SIZE. */ - -extern int gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch); - -typedef const struct regset * (gdbarch_regset_from_core_section_ftype) (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size); -extern const struct regset * gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size); -extern void set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch, gdbarch_regset_from_core_section_ftype *regset_from_core_section); - /* Iterate over all supported register notes in a core file. For each supported register note section, the iterator must call CB and pass CB_DATA unchanged. If REGCACHE is not NULL, the iterator can limit diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 293854f..c785887 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -651,10 +651,6 @@ m:int:register_reggroup_p:int regnum, struct reggroup *reggroup:regnum, reggroup # Fetch the pointer to the ith function argument. F:CORE_ADDR:fetch_pointer_argument:struct frame_info *frame, int argi, struct type *type:frame, argi, type -# Return the appropriate register set for a core file section with -# name SECT_NAME and size SECT_SIZE. -M:const struct regset *:regset_from_core_section:const char *sect_name, size_t sect_size:sect_name, sect_size - # Iterate over all supported register notes in a core file. For each # supported register note section, the iterator must call CB and pass # CB_DATA unchanged. If REGCACHE is not NULL, the iterator can limit diff --git a/gdb/procfs.c b/gdb/procfs.c index 3465bc5..4607b8c 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -5371,7 +5371,7 @@ procfs_do_thread_registers (bfd *obfd, ptid_t ptid, /* This part is the old method for fetching registers. It should be replaced by the newer one using regsets once it is implemented in this platform: - gdbarch_regset_from_core_section() and regset->collect_regset(). */ + gdbarch_iterate_over_regset_sections(). */ old_chain = save_inferior_ptid (); inferior_ptid = ptid;