From patchwork Thu Dec 27 14:08:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 30856 Received: (qmail 119337 invoked by alias); 27 Dec 2018 14:09:04 -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 119251 invoked by uid 89); 27 Dec 2018 14:09:03 -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=onto, HTo:U*hp X-HELO: mail-wr1-f68.google.com Received: from mail-wr1-f68.google.com (HELO mail-wr1-f68.google.com) (209.85.221.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Dec 2018 14:09:01 +0000 Received: by mail-wr1-f68.google.com with SMTP id z5so18371120wrt.11 for ; Thu, 27 Dec 2018 06:09:00 -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=UvHolcBqijse+euGdheJqB3Ul0NYq7grm67NcrRYSP0=; b=DhQTHSOMS71A+wJwnyFxRJqz6YQSRfiRBBw1YTSSUJ5LDK7F1gZ2PgOK7rp+Vyt/bN C7TcMaK/hFDceIxN147GhOnW1EDAUAa6uCxjIasLH9+Pk63iL+BIFNQ7KRFWmo5QSvxC HXmpdL1Ncc6XIHenDcA3f7rZTw7en0cyOx59fROghIz3Ngr4n0rVSgi/YKZQOSiZjhYF G+8o0pmPbYSI6+dv0Ordi4y/gsXg2N9JH1RYNuo8SlmOa+TqAfY7rT10PE6lO9NVGgIM yqabEPQGnu9hzxKUO5a8IaNC4xClNAbqygFxQ66R4CcqjxxMpyKRbR4lTPgujuM6zwKF cwsw== Return-Path: Received: from localhost (host86-156-236-210.range86-156.btcentralplus.com. [86.156.236.210]) by smtp.gmail.com with ESMTPSA id h13sm28572411wrp.61.2018.12.27.06.08.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Dec 2018 06:08:57 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org, hp@axis.com Cc: alan.hayward@arm.com, abidh@codesourcery.com, Anton.Kolesov@synopsys.com, jamesb@excamera.com, vapier@gentoo.org, Andrew Burgess Subject: [PATCH 06/12] gdb/cris: Use default gdbarch methods where possible Date: Thu, 27 Dec 2018 14:08:30 +0000 Message-Id: <8df6b1c63db76b4d34e92d51295e4ba91ed8ba14.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/cris-tdep.c (cris_dummy_id): Delete. (cris_unwind_pc): Delete. (cris_unwind_sp): Delete. (cris_gdbarch_init): Don't register deleted functions with gdbarch. --- gdb/ChangeLog | 8 ++++++++ gdb/cris-tdep.c | 40 ---------------------------------------- 2 files changed, 8 insertions(+), 40 deletions(-) diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index f9fdd86a3c4..962f935a8c3 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -651,12 +651,6 @@ static CORE_ADDR crisv32_scan_prologue (CORE_ADDR pc, struct frame_info *this_frame, struct cris_unwind_cache *info); -static CORE_ADDR cris_unwind_pc (struct gdbarch *gdbarch, - struct frame_info *next_frame); - -static CORE_ADDR cris_unwind_sp (struct gdbarch *gdbarch, - struct frame_info *next_frame); - /* When arguments must be pushed onto the stack, they go on in reverse order. The below implements a FILO (stack) to do this. Copied from d10v-tdep.c. */ @@ -767,18 +761,6 @@ cris_frame_prev_register (struct frame_info *this_frame, return trad_frame_get_prev_register (this_frame, info->saved_regs, regnum); } -/* Assuming THIS_FRAME is a dummy, return the frame ID of that dummy - frame. The frame ID's base needs to match the TOS value saved by - save_dummy_frame_tos(), and the PC match the dummy frame's breakpoint. */ - -static struct frame_id -cris_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - CORE_ADDR sp; - sp = get_frame_register_unsigned (this_frame, gdbarch_sp_regnum (gdbarch)); - return frame_id_build (sp, get_frame_pc (this_frame)); -} - static CORE_ADDR cris_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp) { @@ -1372,24 +1354,6 @@ cris_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) return pc_after_prologue; } -static CORE_ADDR -cris_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - ULONGEST pc; - pc = frame_unwind_register_unsigned (next_frame, - gdbarch_pc_regnum (gdbarch)); - return pc; -} - -static CORE_ADDR -cris_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - ULONGEST sp; - sp = frame_unwind_register_unsigned (next_frame, - gdbarch_sp_regnum (gdbarch)); - return sp; -} - /* Implement the breakpoint_kind_from_pc gdbarch method. */ static int @@ -4095,10 +4059,6 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_breakpoint_kind_from_pc (gdbarch, cris_breakpoint_kind_from_pc); set_gdbarch_sw_breakpoint_from_kind (gdbarch, cris_sw_breakpoint_from_kind); - set_gdbarch_unwind_pc (gdbarch, cris_unwind_pc); - set_gdbarch_unwind_sp (gdbarch, cris_unwind_sp); - set_gdbarch_dummy_id (gdbarch, cris_dummy_id); - if (tdep->cris_dwarf2_cfi == 1) { /* Hook in the Dwarf-2 frame sniffer. */