From patchwork Wed Mar 27 21:34:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 32025 Received: (qmail 100443 invoked by alias); 27 Mar 2019 21:35:08 -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 99353 invoked by uid 89); 27 Mar 2019 21:34:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 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=ham version=3.3.1 spammy= X-HELO: mail-wr1-f53.google.com Received: from mail-wr1-f53.google.com (HELO mail-wr1-f53.google.com) (209.85.221.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Mar 2019 21:34:56 +0000 Received: by mail-wr1-f53.google.com with SMTP id q1so20367464wrp.0 for ; Wed, 27 Mar 2019 14:34:56 -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=YYI3Tw99lJ4rPTHig9gU+2dQD8oejZCAVJb4yHCYWq4=; b=VVLOp4UGKgSPtbu/DDCafWNQni89qenufb0dBuK316PCx/6rnF4SbAINeXaf3P3nsZ WF/pJpLIwgv04JXS2CHOQQE8CAWoKt1kLG+0XFPPoXxS0A7I0mUp//bGkRoSc2R6ADY9 kVidxkutw4jfo92QypI+NBNjNeRVAoXFjIQpWPjDIJ4k+9zzgmES8lYdsK7GE43EkKCZ wqxrci+wjVGQ9feFAGMuBEvwLCzHlobl631AYDbDxz8wlWRYd9Po0lYmB2Jxb5V0Uz0B nFM7jqQTzWj0EQ1E94nHmUcpvE3TF0ZBqPR1COmWkVFm8YBF/xRSimnjecpQd0nSU2Bd PPxQ== Return-Path: Received: from localhost (host81-151-161-58.range81-151.btcentralplus.com. [81.151.161.58]) by smtp.gmail.com with ESMTPSA id z8sm23278861wrh.80.2019.03.27.14.34.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 14:34:53 -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 15/25] gdb/rx: Use default gdbarch methods where possible Date: Wed, 27 Mar 2019 21:34:11 +0000 Message-Id: <8cbc8f11ae9db3523962c9000a230008bdf85f99.1553721877.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: * rx-tdep.c (rx_unwind_pc): Delete. (rx_unwind_sp): Delete. (rx_dummy_id): Delete. (rx_gdbarch_init): Don't register deleted functions with gdbarch. Update comment. --- gdb/ChangeLog | 8 ++++++++ gdb/rx-tdep.c | 38 ++------------------------------------ 2 files changed, 10 insertions(+), 36 deletions(-) diff --git a/gdb/rx-tdep.c b/gdb/rx-tdep.c index 2825c799ad8..4cbf919db96 100644 --- a/gdb/rx-tdep.c +++ b/gdb/rx-tdep.c @@ -751,35 +751,6 @@ static const struct frame_unwind rx_exception_unwind = { rx_exception_sniffer }; -/* Implement the "unwind_pc" gdbarch method. */ -static CORE_ADDR -rx_unwind_pc (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - ULONGEST pc; - - pc = frame_unwind_register_unsigned (this_frame, RX_PC_REGNUM); - return pc; -} - -/* Implement the "unwind_sp" gdbarch method. */ -static CORE_ADDR -rx_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - ULONGEST sp; - - sp = frame_unwind_register_unsigned (this_frame, RX_SP_REGNUM); - return sp; -} - -/* Implement the "dummy_id" gdbarch method. */ -static struct frame_id -rx_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - return - frame_id_build (get_frame_register_unsigned (this_frame, RX_SP_REGNUM), - get_frame_pc (this_frame)); -} - /* Implement the "push_dummy_call" gdbarch method. */ static CORE_ADDR rx_push_dummy_call (struct gdbarch *gdbarch, struct value *function, @@ -1112,9 +1083,6 @@ rx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sw_breakpoint_from_kind (gdbarch, rx_breakpoint::bp_from_kind); set_gdbarch_skip_prologue (gdbarch, rx_skip_prologue); - set_gdbarch_unwind_pc (gdbarch, rx_unwind_pc); - set_gdbarch_unwind_sp (gdbarch, rx_unwind_sp); - /* Target builtin data types. */ set_gdbarch_char_signed (gdbarch, 0); set_gdbarch_short_bit (gdbarch, 16); @@ -1147,10 +1115,8 @@ rx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) dwarf2_append_unwinders (gdbarch); frame_unwind_append_unwinder (gdbarch, &rx_frame_unwind); - /* Methods for saving / extracting a dummy frame's ID. - The ID's stack address must match the SP value returned by - PUSH_DUMMY_CALL, and saved by generic_save_dummy_frame_tos. */ - set_gdbarch_dummy_id (gdbarch, rx_dummy_id); + /* Methods setting up a dummy call, and extracting the return value from + a call. */ set_gdbarch_push_dummy_call (gdbarch, rx_push_dummy_call); set_gdbarch_return_value (gdbarch, rx_return_value);