From patchwork Wed Mar 27 21:34:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 32035 Received: (qmail 103348 invoked by alias); 27 Mar 2019 21:35:33 -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 101216 invoked by uid 89); 27 Mar 2019 21:35:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.3 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=HX-Languages-Length:1800, 9520 X-HELO: mail-wm1-f49.google.com Received: from mail-wm1-f49.google.com (HELO mail-wm1-f49.google.com) (209.85.128.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Mar 2019 21:35:13 +0000 Received: by mail-wm1-f49.google.com with SMTP id f3so1460516wmj.4 for ; Wed, 27 Mar 2019 14:35:12 -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=Wrk93FsHWMThVRs0LeiDyXX0bCQxSGd6V+DaF4kz1HA=; b=B4uaIn2bG+YofCUtn9lVk2z8uC2i3ekctPnHT3LkV7RUrhTxDBCtr1d9nOYFNUGoz+ CpSGiEwLUY6/8a05PjJpW072Mwo7KO0W7BJcumlTPcFij/O/YlqN2KD/2iXMbrdXZtgs LuBCXUz+uYKwjmVdZEvNNiL2gqVdnPE/bsqIX1m5OReazGl5YF7/1ihhRd/1JphZqvTS 8GFarzzBh7+pA6ghLTQzmKMHTtyEuMDjHppWjnlf6+8wn2FBwXaio2V6xxUXijYgL5q9 xYxmIKQowZb4lLB2qSHiEtp1oInDqSgP7D4VbuaCvxto1OOotaxUsy44flbCXcbHBiWK nf5A== Return-Path: Received: from localhost (host81-151-161-58.range81-151.btcentralplus.com. [81.151.161.58]) by smtp.gmail.com with ESMTPSA id v14sm30047915wrr.20.2019.03.27.14.35.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 14:35:10 -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 25/25] gdb/s12z: Use default gdbarch methods where possible Date: Wed, 27 Mar 2019 21:34:21 +0000 Message-Id: <2b80ddf8a1c06b2134ae167a5bed9ea231ac227c.1553721879.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_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: * s12z-tdep.c (s12z_unwind_pc): Delete. (s12z_unwind_sp): Delete. (s12z_gdbarch_init): Don't register deleted functions with gdbarch. --- gdb/ChangeLog | 7 +++++++ gdb/s12z-tdep.c | 18 ------------------ 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/gdb/s12z-tdep.c b/gdb/s12z-tdep.c index ea14992b1c6..cef92d87743 100644 --- a/gdb/s12z-tdep.c +++ b/gdb/s12z-tdep.c @@ -95,20 +95,6 @@ s12z_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) return pc; } -/* Implement the unwind_pc gdbarch method. */ -static CORE_ADDR -s12z_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, REG_P); -} - -/* Implement the unwind_sp gdbarch method. */ -static CORE_ADDR -s12z_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, REG_S); -} - static struct type * s12z_register_type (struct gdbarch *gdbarch, int reg_nr) { @@ -581,10 +567,6 @@ s12z_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_type (gdbarch, s12z_register_type); - /* Functions to access frame data. */ - set_gdbarch_unwind_pc (gdbarch, s12z_unwind_pc); - set_gdbarch_unwind_sp (gdbarch, s12z_unwind_sp); - frame_unwind_append_unwinder (gdbarch, &s12z_frame_unwind); /* Currently, the only known producer for this archtecture, produces buggy dwarf CFI. So don't append a dwarf unwinder until the situation is