From patchwork Wed Mar 27 21:34:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 32030 Received: (qmail 102110 invoked by alias); 27 Mar 2019 21:35:22 -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 100211 invoked by uid 89); 27 Mar 2019 21:35:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.1 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-wm1-f66.google.com Received: from mail-wm1-f66.google.com (HELO mail-wm1-f66.google.com) (209.85.128.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Mar 2019 21:35:04 +0000 Received: by mail-wm1-f66.google.com with SMTP id y197so1680639wmd.0 for ; Wed, 27 Mar 2019 14:35:04 -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=2aFLXqJYhkvINr9bvfwXKPJK4vCXrbITLFoQoE9dAOE=; b=Zf6zULDnKsAdSoUP5Hugyk8NB4GU24oOf0EncXK68QkxRGo/TFryFrLs8pFdDNPYLJ jyxnYCJoBTwojJ6Ro7zzQTN10ltfyorTaB4Wp8U5O2GlbUAnAZ4XBgjgb07oC5oXot3V fNcw+W+En+uHtO7tWoKyB3DtzuJVR0Nbk2gsVyQY3VISs4C3Cdi81HpG7fR7U5rPisHd 1cKjqIcAkBSdjEnl7306dYV9rkfRvde4JHZuO50WZCJb8q0HYFksbE3rydXq94bcZA/I GK/f2Uz1eiYJy3XWO7JQsUH/NLlj0zwKVgYNWdoAHLf+KIwIbwVt30W2wFObMkIM/QJi GOXQ== Return-Path: Received: from localhost (host81-151-161-58.range81-151.btcentralplus.com. [81.151.161.58]) by smtp.gmail.com with ESMTPSA id b204sm1829626wmh.29.2019.03.27.14.35.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 14:35:01 -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 20/25] gdb/tilegx: Use default gdbarch methods where possible Date: Wed, 27 Mar 2019 21:34:16 +0000 Message-Id: <351695e4c0497b48d6ed2c74a4c6e6e8006e62b9.1553721878.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: * tilegx-tdep.c (tilegx_unwind_sp): Delete. (tilegx_unwind_pc): Delete. (tilegx_unwind_dummy_id): Delete. (tilegx_gdbarch_init): Don't register deleted functions with gdbarch. --- gdb/ChangeLog | 8 ++++++++ gdb/tilegx-tdep.c | 26 -------------------------- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c index 3b1954fe419..a5f05ef1515 100644 --- a/gdb/tilegx-tdep.c +++ b/gdb/tilegx-tdep.c @@ -930,29 +930,6 @@ static const struct frame_base tilegx_frame_base = { tilegx_frame_base_address }; -static CORE_ADDR -tilegx_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, TILEGX_SP_REGNUM); -} - -static CORE_ADDR -tilegx_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, TILEGX_PC_REGNUM); -} - -static struct frame_id -tilegx_unwind_dummy_id (struct gdbarch *gdbarch, - struct frame_info *this_frame) -{ - CORE_ADDR sp; - - sp = get_frame_register_unsigned (this_frame, TILEGX_SP_REGNUM); - return frame_id_build (sp, get_frame_pc (this_frame)); -} - - /* We cannot read/write the "special" registers. */ static int @@ -1027,9 +1004,6 @@ tilegx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_inner_than (gdbarch, core_addr_lessthan); /* Frame Info. */ - set_gdbarch_unwind_sp (gdbarch, tilegx_unwind_sp); - set_gdbarch_unwind_pc (gdbarch, tilegx_unwind_pc); - set_gdbarch_dummy_id (gdbarch, tilegx_unwind_dummy_id); set_gdbarch_frame_align (gdbarch, tilegx_frame_align); frame_base_set_default (gdbarch, &tilegx_frame_base);