From patchwork Thu Dec 27 14:08:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 30851 Received: (qmail 117747 invoked by alias); 27 Dec 2018 14:08:53 -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 117617 invoked by uid 89); 27 Dec 2018 14:08:52 -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=Advance X-HELO: mail-wm1-f65.google.com Received: from mail-wm1-f65.google.com (HELO mail-wm1-f65.google.com) (209.85.128.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Dec 2018 14:08:51 +0000 Received: by mail-wm1-f65.google.com with SMTP id m1so16845786wml.2 for ; Thu, 27 Dec 2018 06:08:50 -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=pCH5UE/c2vmqks+EM2M7+e6dL9d4VTS/Yk4RJFSyVVE=; b=Kejgz1NiVenwwH6tdv9t7/z9hIYsf+bQGPFPxdV8LNY9eqemOoo0v3WU+j/86H7qkr 23TyJknCOuUVNPowYMH6fBlhsi+b+MnoFC1rcqiTSuVjskLvxnMyzbAuwuLDLyxjL1DE kwMCuC9rb+h1Cs15xVgoBp1tig8nKD87yy18BvY7RLaHenWErOlghyDWEJD3ovwVmAMg gP/fk2DzP7mca0qJJCBNKymTnIIdHbs+X5jL7Si3XG+vLDzzbFNCOGJbW3XhWO9Y7VhD y8TZ+nLfMO5/JBWgW+GytKc02dCVmH8uU0SK8lprsugALEAVIlRH3vTMhcr55PAFTsKu YI1A== Return-Path: Received: from localhost (host86-156-236-210.range86-156.btcentralplus.com. [86.156.236.210]) by smtp.gmail.com with ESMTPSA id k26sm22226569wmi.28.2018.12.27.06.08.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Dec 2018 06:08:47 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org, alan.hayward@arm.com Cc: abidh@codesourcery.com, Anton.Kolesov@synopsys.com, hp@axis.com, jamesb@excamera.com, vapier@gentoo.org, Andrew Burgess Subject: [PATCH 01/12] gdb/aarch64: Use default gdbarch methods where possible Date: Thu, 27 Dec 2018 14:08:25 +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: * gdb/aarch64-tdep.c (aarch64_dummy_id): Delete. (aarch64_unwind_pc): Delete. (aarch64_unwind_sp): Delete. (aarch64_gdbarch_init): Don't register deleted functions with gdbarch. --- gdb/ChangeLog | 8 ++++++++ gdb/aarch64-tdep.c | 38 -------------------------------------- 2 files changed, 8 insertions(+), 38 deletions(-) diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index ae56c9ca34c..34ee41b0a50 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -998,39 +998,6 @@ struct frame_base aarch64_normal_base = aarch64_normal_frame_base }; -/* 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 returned from - aarch64_push_dummy_call, and the PC needs to match the dummy - frame's breakpoint. */ - -static struct frame_id -aarch64_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - return frame_id_build (get_frame_register_unsigned (this_frame, - AARCH64_SP_REGNUM), - get_frame_pc (this_frame)); -} - -/* Implement the "unwind_pc" gdbarch method. */ - -static CORE_ADDR -aarch64_unwind_pc (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - CORE_ADDR pc - = frame_unwind_register_unsigned (this_frame, AARCH64_PC_REGNUM); - - return pc; -} - -/* Implement the "unwind_sp" gdbarch method. */ - -static CORE_ADDR -aarch64_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - return frame_unwind_register_unsigned (this_frame, AARCH64_SP_REGNUM); -} - /* Return the value of the REGNUM register in the previous frame of *THIS_FRAME. */ @@ -3062,11 +3029,6 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_push_dummy_call (gdbarch, aarch64_push_dummy_call); set_gdbarch_frame_align (gdbarch, aarch64_frame_align); - /* Frame handling. */ - set_gdbarch_dummy_id (gdbarch, aarch64_dummy_id); - set_gdbarch_unwind_pc (gdbarch, aarch64_unwind_pc); - set_gdbarch_unwind_sp (gdbarch, aarch64_unwind_sp); - /* Advance PC across function entry code. */ set_gdbarch_skip_prologue (gdbarch, aarch64_skip_prologue);