From patchwork Thu Dec 27 14:08:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 30854 Received: (qmail 118692 invoked by alias); 27 Dec 2018 14:08:59 -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 118613 invoked by uid 89); 27 Dec 2018 14:08:59 -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=resume 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:57 +0000 Received: by mail-wm1-f65.google.com with SMTP id t200so5564517wmt.0 for ; Thu, 27 Dec 2018 06:08:56 -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=4M32dYEW15h3q2Gn5zPbYoWsKUREfYInWBtBrbMvmTE=; b=Pf4ParVGqtp9YxRupV0caurNvnUjcrWObrH9tq7o6WiOOBB16nER7bOgwqyw8+dwmZ 8zlGhyIh6mP01SkqnuGVlaZ0QhgLv6gW6bHy+GNQ0EQiPY4t44RUcw3U9rEYX0QZ5oj/ QaKI7vRR0g4N87yytxljX76qMXB6QqfkpclWuFKTa3FwBfi5P9YTB6pEJr5ima4tdVGk fHpsKbgeM4BoqL6JjIHZwbQ+CWdGaTfTOU9EBz1PhBswI/YLqVLo9KUKk1dOK/agm5u5 H3Q/frZgNHhjrZWdAE8GgjJBztbNuC6GZ1Ja0LcysXgY1Y556VDvLtMTUyT5ywL0xIeR AcKA== Return-Path: Received: from localhost (host86-156-236-210.range86-156.btcentralplus.com. [86.156.236.210]) by smtp.gmail.com with ESMTPSA id b12sm23298743wrt.17.2018.12.27.06.08.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Dec 2018 06:08:53 -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 04/12] gdb/arm: Use default gdbarch methods where possible Date: Thu, 27 Dec 2018 14:08:28 +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/arm-tdep.c (arm_dummy_id): Delete. (arm_unwind_pc): Delete. (arm_unwind_sp): Delete. (arm_gdbarch_init): Don't register deleted functions with gdbarch. --- gdb/ChangeLog | 7 +++++++ gdb/arm-tdep.c | 37 ------------------------------------- 2 files changed, 7 insertions(+), 37 deletions(-) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 157f926afcd..91d597b6e94 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -3059,38 +3059,6 @@ struct frame_base arm_normal_base = { arm_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 - arm_push_dummy_call, and the PC needs to match the dummy frame's - breakpoint. */ - -static struct frame_id -arm_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - return frame_id_build (get_frame_register_unsigned (this_frame, - ARM_SP_REGNUM), - get_frame_pc (this_frame)); -} - -/* Given THIS_FRAME, find the previous frame's resume PC (which will - be used to construct the previous frame's ID, after looking up the - containing function). */ - -static CORE_ADDR -arm_unwind_pc (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - CORE_ADDR pc; - pc = frame_unwind_register_unsigned (this_frame, ARM_PC_REGNUM); - return arm_addr_bits_remove (gdbarch, pc); -} - -static CORE_ADDR -arm_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - return frame_unwind_register_unsigned (this_frame, ARM_SP_REGNUM); -} - static struct value * arm_dwarf2_prev_register (struct frame_info *this_frame, void **this_cache, int regnum) @@ -9362,11 +9330,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_write_pc (gdbarch, arm_write_pc); - /* Frame handling. */ - set_gdbarch_dummy_id (gdbarch, arm_dummy_id); - set_gdbarch_unwind_pc (gdbarch, arm_unwind_pc); - set_gdbarch_unwind_sp (gdbarch, arm_unwind_sp); - frame_base_set_default (gdbarch, &arm_normal_base); /* Address manipulation. */