From patchwork Thu Dec 27 14:08:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 30857 Received: (qmail 119615 invoked by alias); 27 Dec 2018 14:09:06 -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 119528 invoked by uid 89); 27 Dec 2018 14:09:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wr1-f65.google.com Received: from mail-wr1-f65.google.com (HELO mail-wr1-f65.google.com) (209.85.221.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Dec 2018 14:09:03 +0000 Received: by mail-wr1-f65.google.com with SMTP id j2so18435816wrw.1 for ; Thu, 27 Dec 2018 06:09:02 -0800 (PST) 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=RAIrV9Q0rm28hjLxhf+HxsBMfL8337RV63lbhD78cTs=; b=YKix8/7bhY7i1EZ6iiL2FEkVuL+XpTPrjgePiXUD+biE3Y8aWjmQgagpPiWy2YZqXx DYBKJu7tHiUfAFWpnM3tbIrR8QDXDAtG3wBL2RNqN3CMVMzYwOvV1Rqe05326a2pG0zZ uDKRiuR7noYZHPHmSB6bY68j37AdW/m+JvDlmd8MxuYgZ6R7kHw6WlOzdlJCPIjWVxzl wKjIc9jK5URYo1HHmIM8D3naZdzNUJP3SkApoVTEqikKNpC2jTkl96MfzJX5frPRnpcH BC+vYxMLiGZW2xM98le1A2mETX+TCTD12/zuX1+I92ThthJ1hlzna0OxGeLp14Lt43Xe eW6g== Return-Path: Received: from localhost (host86-156-236-210.range86-156.btcentralplus.com. [86.156.236.210]) by smtp.gmail.com with ESMTPSA id h17sm26410269wrt.59.2018.12.27.06.08.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Dec 2018 06:08:59 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org, abidh@codesourcery.com Cc: alan.hayward@arm.com, Anton.Kolesov@synopsys.com, hp@axis.com, jamesb@excamera.com, vapier@gentoo.org, Andrew Burgess Subject: [PATCH 07/12] gdb/csky: Use default gdbarch methods where possible Date: Thu, 27 Dec 2018 14:08:31 +0000 Message-Id: <1cec9a0fb5d672a9448afbe03a781dd2ad72dbbd.1545918069.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: * gdb/csky-tdep.c (csky_dummy_id): Delete. (csky_unwind_pc): Delete. (csky_unwind_sp): Delete. (csky_gdbarch_init): Don't register deleted functions with gdbarch. --- gdb/ChangeLog | 8 ++++++++ gdb/csky-tdep.c | 34 ---------------------------------- 2 files changed, 8 insertions(+), 34 deletions(-) diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c index ed56aed97a4..0bac82f0c75 100644 --- a/gdb/csky-tdep.c +++ b/gdb/csky-tdep.c @@ -162,14 +162,6 @@ csky_write_pc (regcache *regcache, CORE_ADDR val) regcache_cooked_write_unsigned (regcache, CSKY_PC_REGNUM, val); } -/* Implement the unwind_sp gdbarch method. */ - -static CORE_ADDR -csky_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, CSKY_SP_REGNUM); -} - /* C-Sky ABI register names. */ static const char *csky_register_names[] = @@ -1885,14 +1877,6 @@ csky_frame_unwind_cache (struct frame_info *this_frame) return cache; } -/* Implement the unwind_pc gdbarch method. */ - -static CORE_ADDR -csky_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, CSKY_PC_REGNUM); -} - /* Implement the this_id function for the normal unwinder. */ static void @@ -2047,19 +2031,6 @@ static const struct frame_base csky_frame_base = { csky_frame_base_address }; -/* Implement the dummy_id gdbarch method. The frame ID's base - needs to match the TOS value saved by save_dummy_frame_tos, - and the PC should match the dummy frame's breakpoint. */ - -static struct frame_id -csky_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - unsigned int sp_regnum = CSKY_SP_REGNUM; - - CORE_ADDR sp = get_frame_register_unsigned (this_frame, sp_regnum); - return frame_id_build (sp, get_frame_pc (this_frame)); -} - /* Initialize register access method. */ static void @@ -2247,13 +2218,8 @@ csky_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_align (gdbarch, csky_frame_align); set_gdbarch_stack_frame_destroyed_p (gdbarch, csky_stack_frame_destroyed_p); - /* Functions to access frame data. */ - set_gdbarch_unwind_pc (gdbarch, csky_unwind_pc); - set_gdbarch_unwind_sp (gdbarch, csky_unwind_sp); - /* Functions handling dummy frames. */ set_gdbarch_push_dummy_call (gdbarch, csky_push_dummy_call); - set_gdbarch_dummy_id (gdbarch, csky_dummy_id); /* Frame unwinders. Use DWARF debug info if available, otherwise use our own unwinder. */