From patchwork Wed Mar 27 21:34:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 32017 Received: (qmail 97812 invoked by alias); 27 Mar 2019 21:34:45 -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 97746 invoked by uid 89); 27 Mar 2019 21:34:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=unavailable version=3.3.1 spammy=Map, HX-Received:c147, HX-Languages-Length:2202 X-HELO: mail-wm1-f67.google.com Received: from mail-wm1-f67.google.com (HELO mail-wm1-f67.google.com) (209.85.128.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Mar 2019 21:34:42 +0000 Received: by mail-wm1-f67.google.com with SMTP id w15so1659818wmc.3 for ; Wed, 27 Mar 2019 14:34:42 -0700 (PDT) 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=Ty4fWCo3rJpclygpwCo2Qyy5D2p/lg4+qFc6oLb5mb0=; b=AwHBvwwEiHrulqtY5xBTcnpSYSq8xY3iFfxBfZ/qf/jSVKuKQS5xkwaG4LK7hDTRF5 ug+2OqpFsUyB7ZodCCU72JUeYROHyJaxCl8vmfzbwZfb95hKtO8bTwcyBv6OJjTGraqY wF4fYIemQsZKl+e2OQQ+umhMJz0qq+eJAU9lIa/Eb3lbwOQl0n/6b/NZPfBp8AoJq99Y tTnHVjcXszDiyjAdxTe5LbQZPyyoCFnWTupBY51TXYZ0LMq9iKkRkngfe+fxie9dSSlV dP0Y8Y1Lq6Dw5Fzpx9y5zW0o9wzzOPPD6LV72jvmEggtBS9MbrK8TOriUHQLNTmNnKwx +5Sw== Return-Path: Received: from localhost (host81-151-161-58.range81-151.btcentralplus.com. [81.151.161.58]) by smtp.gmail.com with ESMTPSA id d17sm22482317wrw.88.2019.03.27.14.34.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 14:34:39 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: kevinb@redhat.com, macro@linux-mips.org, brobecker@adacore.com, green@moxielogic.com, qiyao@sourceware.org, shorne@gmail.com, Andrew Burgess Subject: [PATCH 07/25] gdb/mips: Use default gdbarch methods where possible Date: Wed, 27 Mar 2019 21:34:03 +0000 Message-Id: <37e90315a0fe012845a405a273903ada24edc88d.1553721874.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, 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. One thing worth noting in this commit is that the accesses to the stack pointer register changes from being signed to unsigned, however, in all cases the register is immediately converted to a CORE_ADDR, so I don't think this will cause any problems. gdb/ChangeLog: * mips-tdep.c (mips_unwind_sp): Delete. (mips_dummy_id): Delete. (mips_gdbarch_init): Don't register deleted functions with gdbarch. --- gdb/ChangeLog | 7 +++++++ gdb/mips-tdep.c | 24 ------------------------ 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index f3361388225..91cc188bdda 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -1403,28 +1403,6 @@ mips_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) return pc; } -static CORE_ADDR -mips_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_signed - (next_frame, gdbarch_num_regs (gdbarch) + MIPS_SP_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 -mips_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - return frame_id_build - (get_frame_register_signed (this_frame, - gdbarch_num_regs (gdbarch) - + MIPS_SP_REGNUM), - get_frame_pc (this_frame)); -} - /* Implement the "write_pc" gdbarch method. */ void @@ -8689,8 +8667,6 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Unwind the frame. */ set_gdbarch_unwind_pc (gdbarch, mips_unwind_pc); - set_gdbarch_unwind_sp (gdbarch, mips_unwind_sp); - set_gdbarch_dummy_id (gdbarch, mips_dummy_id); /* Map debug register numbers onto internal register numbers. */ set_gdbarch_stab_reg_to_regnum (gdbarch, mips_stab_reg_to_regnum);