From patchwork Wed Mar 27 21:34:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 32023 Received: (qmail 99441 invoked by alias); 27 Mar 2019 21:34:58 -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 98781 invoked by uid 89); 27 Mar 2019 21:34:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.7 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=HX-Gm-Message-State:APjAAAX X-HELO: mail-wm1-f67.google.com Received: from mail-wm1-f67.google.com (HELO mail-wm1-f67.google.com) (209.85.128.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Mar 2019 21:34:51 +0000 Received: by mail-wm1-f67.google.com with SMTP id o10so5777092wmc.1 for ; Wed, 27 Mar 2019 14:34:51 -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=537tTra1W67IOXYUixQ+cuYOmLbdY1/S9ZhaZYXC27o=; b=J1L8+uXzI486Jyvhm4NsFt67TtmxGF7X3H/ccRcDrg3PhK2nq5pDeL++Af618ajdm/ GeTchYyP6qRP5Nawt4B4DqxDooIvrtcutE5zUjrrhVaheDjJgPvpLfwR8wXJTWSnzzI9 32VW2qT8tB3QixmgM5ROpiEd4yf8w0Y/dY/xbML8tvf+wuIhsW9tvhxTXJAwmYLq2qse 9NaUSXGieuADeEuMshf2jEDRrNgiOUTgtzKbo54HxnZfVQGCm2qq2g1IYDPzJX03B5Ay hLBXrVJSgkD7aHzEcK7TuIBE+d5EeGGCKYH5bF7/ovUCdRxTTQqUEEwkDgREvjCX3cLK YytA== Return-Path: Received: from localhost (host81-151-161-58.range81-151.btcentralplus.com. [81.151.161.58]) by smtp.gmail.com with ESMTPSA id h2sm42231174wro.11.2019.03.27.14.34.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 14:34:48 -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 12/25] gdb/nios2: Use default gdbarch methods where possible Date: Wed, 27 Mar 2019 21:34:08 +0000 Message-Id: <7c2bfae3a3f3bdb129e24a99a127664e86473ee2.1553721876.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, 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: * nios2-tdep.c (nios2_dummy_id): Delete. (nios2_unwind_sp): Delete. (nios2_gdbarch_init): Don't register deleted functions with gdbarch. --- gdb/ChangeLog | 7 +++++++ gdb/nios2-tdep.c | 20 -------------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c index ee45db98af6..7f18828b5a8 100644 --- a/gdb/nios2-tdep.c +++ b/gdb/nios2-tdep.c @@ -1795,16 +1795,6 @@ nios2_return_value (struct gdbarch *gdbarch, struct value *function, return RETURN_VALUE_REGISTER_CONVENTION; } -/* Implement the dummy_id gdbarch method. */ - -static struct frame_id -nios2_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - return frame_id_build - (get_frame_register_unsigned (this_frame, NIOS2_SP_REGNUM), - get_frame_pc (this_frame)); -} - /* Implement the push_dummy_call gdbarch method. */ static CORE_ADDR @@ -1896,14 +1886,6 @@ nios2_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) return extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr); } -/* Implement the unwind_sp gdbarch method. */ - -static CORE_ADDR -nios2_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - return frame_unwind_register_unsigned (this_frame, NIOS2_SP_REGNUM); -} - /* Use prologue analysis to fill in the register cache *THIS_PROLOGUE_CACHE for THIS_FRAME. This function initializes *THIS_PROLOGUE_CACHE first. */ @@ -2356,9 +2338,7 @@ nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_breakpoint_kind_from_pc (gdbarch, nios2_breakpoint_kind_from_pc); set_gdbarch_sw_breakpoint_from_kind (gdbarch, nios2_sw_breakpoint_from_kind); - set_gdbarch_dummy_id (gdbarch, nios2_dummy_id); set_gdbarch_unwind_pc (gdbarch, nios2_unwind_pc); - set_gdbarch_unwind_sp (gdbarch, nios2_unwind_sp); /* The dwarf2 unwinder will normally produce the best results if the debug information is available, so register it first. */