From patchwork Wed Mar 27 21:34:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 32033 Received: (qmail 103125 invoked by alias); 27 Mar 2019 21:35:31 -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 100831 invoked by uid 89); 27 Mar 2019 21:35:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.2 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=H*RU:209.85.128.68, HX-Spam-Relays-External:209.85.128.68 X-HELO: mail-wm1-f68.google.com Received: from mail-wm1-f68.google.com (HELO mail-wm1-f68.google.com) (209.85.128.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Mar 2019 21:35:09 +0000 Received: by mail-wm1-f68.google.com with SMTP id y197so1680806wmd.0 for ; Wed, 27 Mar 2019 14:35:09 -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=9oyxZ9+/Bxkz8K8qaL8Q8UMw/Kx2JCJYj+zhlGBn5CI=; b=ag6LGKKGq73/BKMsI5R3YulrWJEaaazIp4IDH3xGTmwweffJThmj9YfinYTIi//T2b FezCXWwfACOS48Zhqh5DMzJXfaDwMN9wr70BPUFBbWHC1wgE008qQ28/ATuVYXsU0NDU FOFbqRY+cypc2IK3UiQLw1NPYGrkgXp6q335E6VpgFo2YE+NsfycSdPb25cWoHQR5OrE mXZROyEreP0XzYvQL4tyLeoWodrL4E8AH8CL6vqAM2rumUpHCgkVfur8+YCCsH+KHWan rC71CwZvSSGNAO0RPcHeesY5UupQzeJ6+Zl798ul7w8v2PbqXEZf+NH7QR6bmMzmTBcQ tL0Q== Return-Path: Received: from localhost (host81-151-161-58.range81-151.btcentralplus.com. [81.151.161.58]) by smtp.gmail.com with ESMTPSA id k14sm998795wmj.26.2019.03.27.14.35.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 14:35:06 -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 23/25] gdb/xstormy16: Use default gdbarch methods where possible Date: Wed, 27 Mar 2019 21:34:19 +0000 Message-Id: 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: * xstormy16-tdep.c (xstormy16_unwind_sp): Delete. (xstormy16_unwind_pc): Delete. (xstormy16_dummy_id): Delete. (xstormy16_gdbarch_init): Don't register deleted functions with gdbarch. --- gdb/ChangeLog | 8 ++++++++ gdb/xstormy16-tdep.c | 23 ----------------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index 49c72e231c5..1555eb1eb4a 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -751,26 +751,6 @@ static const struct frame_base xstormy16_frame_base = { xstormy16_frame_base_address }; -static CORE_ADDR -xstormy16_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, E_SP_REGNUM); -} - -static CORE_ADDR -xstormy16_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, E_PC_REGNUM); -} - -static struct frame_id -xstormy16_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - CORE_ADDR sp = get_frame_register_unsigned (this_frame, E_SP_REGNUM); - return frame_id_build (sp, get_frame_pc (this_frame)); -} - - /* Function: xstormy16_gdbarch_init Initializer function for the xstormy16 gdbarch vector. Called by gdbarch. Sets up the gdbarch vector(s) for this target. */ @@ -824,9 +804,6 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* * Frame Info */ - set_gdbarch_unwind_sp (gdbarch, xstormy16_unwind_sp); - set_gdbarch_unwind_pc (gdbarch, xstormy16_unwind_pc); - set_gdbarch_dummy_id (gdbarch, xstormy16_dummy_id); set_gdbarch_frame_align (gdbarch, xstormy16_frame_align); frame_base_set_default (gdbarch, &xstormy16_frame_base);