From patchwork Wed Mar 27 21:34:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 32016 Received: (qmail 97599 invoked by alias); 27 Mar 2019 21:34:43 -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 97537 invoked by uid 89); 27 Mar 2019 21:34:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.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=unavailable version=3.3.1 spammy=HX-Received:a7b, 23176, Our, our 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:34:41 +0000 Received: by mail-wm1-f49.google.com with SMTP id o10so5776845wmc.1 for ; Wed, 27 Mar 2019 14:34:40 -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=LBy+/Eft3jSoOsBqdBmFXUlMCSNVF0c4xrXFKIpm320=; b=SjFPq+xGW5Jpj6N9KI/GOhgD6FeYO7wBQz1pP6wBeDx+Z5CKWEvcayVPweIyBffFRA ybk41AU3LaX5+FRPHIOnpdc54YhJ+4gsxfg2CKbRlzW/EgfLBribTm0nc1sYmMFuAz+I 8HP2G5hIVCOlbXXyM2t4VekHbJ0AAeDON8QVPBw069yUCWuXt3PxK6+f+/K70AoqnQZj ROAUG2nqraegLkdLUVrVt+Rvu9mAD8STSvf4koEpIQky1D41sLm321n6isAAvvjhZ6v+ 7GJ58fjtTMBbOXMuUMbYlsKUBSjSygfTS7QaXgMTqfQXK6WsjuRyEioEKonKo9UEtN5P tKGQ== Return-Path: Received: from localhost (host81-151-161-58.range81-151.btcentralplus.com. [81.151.161.58]) by smtp.gmail.com with ESMTPSA id v14sm30047103wrr.20.2019.03.27.14.34.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 14:34:37 -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 06/25] gdb/mep: Use default gdbarch methods where possible Date: Wed, 27 Mar 2019 21:34:02 +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: * mep-tdep.c (mep_unwind_pc): Delete. (mep_unwind_sp): Delete. (mep_dummy_id): Delete. (mep_gdbarch_init): Don't register deleted functions with gdbarch. --- gdb/ChangeLog | 8 ++++++++ gdb/mep-tdep.c | 29 ----------------------------- 2 files changed, 8 insertions(+), 29 deletions(-) diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index 3288291a461..5b1d64c991c 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -2061,23 +2061,6 @@ static const struct frame_unwind mep_frame_unwind = { default_frame_sniffer }; - -/* Our general unwinding function can handle unwinding the PC. */ -static CORE_ADDR -mep_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, MEP_PC_REGNUM); -} - - -/* Our general unwinding function can handle unwinding the SP. */ -static CORE_ADDR -mep_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, MEP_SP_REGNUM); -} - - /* Return values. */ @@ -2334,15 +2317,6 @@ mep_push_dummy_call (struct gdbarch *gdbarch, struct value *function, return sp; } - -static struct frame_id -mep_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - CORE_ADDR sp = get_frame_register_unsigned (this_frame, MEP_SP_REGNUM); - return frame_id_build (sp, get_frame_pc (this_frame)); -} - - /* Initialization. */ @@ -2461,8 +2435,6 @@ mep_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Frames and frame unwinding. */ frame_unwind_append_unwinder (gdbarch, &mep_frame_unwind); - set_gdbarch_unwind_pc (gdbarch, mep_unwind_pc); - set_gdbarch_unwind_sp (gdbarch, mep_unwind_sp); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_frame_args_skip (gdbarch, 0); @@ -2472,7 +2444,6 @@ mep_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Inferior function calls. */ set_gdbarch_frame_align (gdbarch, mep_frame_align); set_gdbarch_push_dummy_call (gdbarch, mep_push_dummy_call); - set_gdbarch_dummy_id (gdbarch, mep_dummy_id); return gdbarch; }