From patchwork Thu Dec 27 14:08:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 30858 Received: (qmail 119850 invoked by alias); 27 Dec 2018 14:09:07 -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 119761 invoked by uid 89); 27 Dec 2018 14:09:07 -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=our 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:04 +0000 Received: by mail-wr1-f68.google.com with SMTP id c14so18403132wrr.0 for ; Thu, 27 Dec 2018 06:09:04 -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=AX1Hb42UaplbLFj1AVz4qGIZ0cFEkCj0h6Oj7aGlgqU=; b=BZ9qf7OLoMekWmcyrQUEG1QbzzBfCZIMU8yaM6Kw6w91ptbITrlhJ5MkaHbljv5LRX QVy9E1W0I7yUr3ZRZmuBpeA/LIDbx9e+JW1bFsUxydwyIqNTcjWh5appYCe8scyOn9N5 nfKqfHq0c9a9kLsZjJBaa2hOaOa4g2cCR0k4PpzDFecDjSiCCHnVi3mYWBg3LjmYEc4t sIAB5jfxIEXudAjFx6ESfiBF7rq/UL5IRq4tW5UJMuL+nXPRUMqfxV5Mp638g0BtGE6g mz19ugPKrKkBF1xdpZ4sNbkLW5wMhvZEniN3AphCnkdthIcRx0+RTI4q6KS44Zt/nBTh y8hg== Return-Path: Received: from localhost (host86-156-236-210.range86-156.btcentralplus.com. [86.156.236.210]) by smtp.gmail.com with ESMTPSA id 126sm65685029wmx.26.2018.12.27.06.09.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Dec 2018 06:09:01 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: alan.hayward@arm.com, abidh@codesourcery.com, Anton.Kolesov@synopsys.com, hp@axis.com, jamesb@excamera.com, vapier@gentoo.org, Andrew Burgess Subject: [PATCH 08/12] gdb/riscv: Use default gdbarch methods where possible Date: Thu, 27 Dec 2018 14:08:32 +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. This change has been tested with no regressions. gdb/ChangeLog: * gdb/riscv-tdep.c (riscv_dummy_id): Delete. (riscv_unwind_pc): Delete. (riscv_unwind_sp): Delete. (riscv_gdbarch_init): Don't register deleted functions with gdbarch. --- gdb/ChangeLog | 8 ++++++++ gdb/riscv-tdep.c | 30 ------------------------------ 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index ef3bb0998d4..d4437f28f74 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -2720,31 +2720,6 @@ riscv_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr) return align_down (addr, 16); } -/* Implement the unwind_pc gdbarch method. */ - -static CORE_ADDR -riscv_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, RISCV_PC_REGNUM); -} - -/* Implement the unwind_sp gdbarch method. */ - -static CORE_ADDR -riscv_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, RISCV_SP_REGNUM); -} - -/* Implement the dummy_id gdbarch method. */ - -static struct frame_id -riscv_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - return frame_id_build (get_frame_register_signed (this_frame, RISCV_SP_REGNUM), - get_frame_pc (this_frame)); -} - /* Generate, or return the cached frame cache for the RiscV frame unwinder. */ @@ -3185,15 +3160,10 @@ riscv_gdbarch_init (struct gdbarch_info info, set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_frame_align (gdbarch, riscv_frame_align); - /* Functions to access frame data. */ - set_gdbarch_unwind_pc (gdbarch, riscv_unwind_pc); - set_gdbarch_unwind_sp (gdbarch, riscv_unwind_sp); - /* Functions handling dummy frames. */ set_gdbarch_call_dummy_location (gdbarch, ON_STACK); set_gdbarch_push_dummy_code (gdbarch, riscv_push_dummy_code); set_gdbarch_push_dummy_call (gdbarch, riscv_push_dummy_call); - set_gdbarch_dummy_id (gdbarch, riscv_dummy_id); /* Frame unwinders. Use DWARF debug info if available, otherwise use our own unwinder. */