From patchwork Wed Mar 27 21:34:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 32026 Received: (qmail 100818 invoked by alias); 27 Mar 2019 21:35:11 -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 99534 invoked by uid 89); 27 Mar 2019 21:34:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=unavailable version=3.3.1 spammy= X-HELO: mail-wr1-f67.google.com Received: from mail-wr1-f67.google.com (HELO mail-wr1-f67.google.com) (209.85.221.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Mar 2019 21:34:58 +0000 Received: by mail-wr1-f67.google.com with SMTP id w10so20340095wrm.4 for ; Wed, 27 Mar 2019 14:34:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=dG7KoL2HwXR02Wg4S1jfFT9XWTVduyQoofRM0poMD4k=; b=aTxHWxW2LgSsCSp+YEA5OEW/1uVrEcJnukwf0d2nptjIbepfhH9GXAcNf/JbZTqI73 ieTX9L0GEbopuVN/5A12hyMIV80P95PL3tQJIAeGB0IVDw1vIMsJPBDgmwLiWjEHSJWf IaKrpgAwcJz4Fwdg3/twfzzrqnys8RZmmtocdc/NMg5TKSqH+shM7F81KPruUvyafBfv fw0SIrsn1AfgMQ3JwZEs6a0OPKwD2GVuWFIxJvhu3gnIRWZad7bZSB4oTcQfmZt4HCNs EZpLKx1GKHhb6mLffFYAGtrxIrQt0f3DOzHXNDzW2jVuvj47waUDup+/A7LKb8lY6lkA RD2Q== Return-Path: Received: from localhost (host81-151-161-58.range81-151.btcentralplus.com. [81.151.161.58]) by smtp.gmail.com with ESMTPSA id i18sm18676857wrm.7.2019.03.27.14.34.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 14:34:55 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: kevinb@redhat.com, macro@linux-mips.org, brobecker@adacore.com, green@moxielogic.com, qiyao@sourceware.org, shorne@gmail.com, Andrew Burgess Subject: [PATCH 16/25] gdb/score: Use default gdbarch methods where possible Date: Wed, 27 Mar 2019 21:34:12 +0000 Message-Id: <3b20309688fab386187d2ca7131dc0fe7c1cba43.1553721877.git.andrew.burgess@embecosm.com> In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes Make use of the default gdbarch methods for gdbarch_dummy_id, gdbarch_unwind_pc, and gdbarch_unwind_sp where possible. I have not tested this change but, by inspecting the code, I believe the default methods are equivalent to the code being deleted. gdb/ChangeLog: * score-tdep.c (score_unwind_sp): Delete. (score_unwind_pc): Delete. (score_dummy_id): Delete. (score_gdbarch_init): Don't register deleted functions with gdbarch. --- gdb/ChangeLog | 8 ++++++++ gdb/score-tdep.c | 23 ----------------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c index 02f4ed4a12b..19306d3464e 100644 --- a/gdb/score-tdep.c +++ b/gdb/score-tdep.c @@ -64,18 +64,6 @@ score_register_type (struct gdbarch *gdbarch, int regnum) return builtin_type (gdbarch)->builtin_uint32; } -static CORE_ADDR -score_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, SCORE_SP_REGNUM); -} - -static CORE_ADDR -score_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, SCORE_PC_REGNUM); -} - static const char * score7_register_name (struct gdbarch *gdbarch, int regnum) { @@ -478,14 +466,6 @@ score_return_value (struct gdbarch *gdbarch, struct value *function, } } -static struct frame_id -score_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - return frame_id_build (get_frame_register_unsigned (this_frame, - SCORE_SP_REGNUM), - get_frame_pc (this_frame)); -} - static int score_type_needs_double_align (struct type *type) { @@ -1480,8 +1460,6 @@ score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_type (gdbarch, score_register_type); set_gdbarch_frame_align (gdbarch, score_frame_align); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); - set_gdbarch_unwind_sp (gdbarch, score_unwind_sp); - set_gdbarch_unwind_pc (gdbarch, score_unwind_pc); switch (target_mach) { @@ -1519,7 +1497,6 @@ score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Dummy frame hooks. */ set_gdbarch_return_value (gdbarch, score_return_value); set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); - set_gdbarch_dummy_id (gdbarch, score_dummy_id); set_gdbarch_push_dummy_call (gdbarch, score_push_dummy_call); /* Normal frame hooks. */