From patchwork Thu Dec 27 14:08:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 30861 Received: (qmail 120726 invoked by alias); 27 Dec 2018 14:09:14 -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 120574 invoked by uid 89); 27 Dec 2018 14:09:13 -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= X-HELO: mail-wm1-f68.google.com Received: from mail-wm1-f68.google.com (HELO mail-wm1-f68.google.com) (209.85.128.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Dec 2018 14:09:10 +0000 Received: by mail-wm1-f68.google.com with SMTP id p6so17558601wmc.1 for ; Thu, 27 Dec 2018 06:09:10 -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=ttdx97K6vl4yugnVccnS2aBcCxhfG4/jQmKs404iIYc=; b=Svndy+8bdukioNMpbPEa6z+RmWry4Q6tvP1o5izKEiPRol/K/8VyKZvMbnwLo/lStB 1ijlYaIQe1oUFKpWUa4zCUg8oknLitecEy7WaYkM7rf12cKmI6XKxQWSu+ck0ZHhAmE7 2iOAteTkrzDkrmKAJlqw/PLYz9gAdaXdi4EaFuwaGOKN0HBn0yGdVaHN0pJRWsJOMhku haItbMq9rybN4qIhkrpkQcG8wxFpI61YXz8myj/v5StPe2U4uHEsJ8APKGO8hsHh1ygP eViPE4SFyarsdg4pYrn2Zy4bK2jg5+HueOUS33tslugdaOJ7nIksKzlJcTSGE1C8miaa bPvA== Return-Path: Received: from localhost (host86-156-236-210.range86-156.btcentralplus.com. [86.156.236.210]) by smtp.gmail.com with ESMTPSA id s5sm7242861wmh.37.2018.12.27.06.09.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Dec 2018 06:09:07 -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 11/12] gdb/h8300: Use default gdbarch methods where possible Date: Thu, 27 Dec 2018 14:08:35 +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/h8300-tdep.c (h8300_unwind_pc): Delete. (h8300_unwind_sp): Delete. (h8300_dummy_id): Delete. (h8300_gdbarch_init): Don't register deleted functions with gdbarch. --- gdb/ChangeLog | 8 ++++++++ gdb/h8300-tdep.c | 22 ---------------------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index eb4efd9efac..5d44429395c 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -92,25 +92,6 @@ static int is_h8300_normal_mode (struct gdbarch *gdbarch); && !is_h8300_normal_mode (gdbarch)) \ ? h8300h_reg_size : h8300_reg_size) -static CORE_ADDR -h8300_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, E_PC_REGNUM); -} - -static CORE_ADDR -h8300_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, E_SP_REGNUM); -} - -static struct frame_id -h8300_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - CORE_ADDR sp = get_frame_register_unsigned (this_frame, E_SP_REGNUM); - return frame_id_build (sp, get_frame_pc (this_frame)); -} - /* Normal frames. */ /* Allocate and initialize a frame cache. */ @@ -1349,9 +1330,6 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_skip_prologue (gdbarch, h8300_skip_prologue); /* Frame unwinder. */ - set_gdbarch_unwind_pc (gdbarch, h8300_unwind_pc); - set_gdbarch_unwind_sp (gdbarch, h8300_unwind_sp); - set_gdbarch_dummy_id (gdbarch, h8300_dummy_id); frame_base_set_default (gdbarch, &h8300_frame_base); /*