From patchwork Thu Nov 29 16:48:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 30393 Received: (qmail 34073 invoked by alias); 29 Nov 2018 16:50:06 -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 27899 invoked by uid 89); 29 Nov 2018 16:48:30 -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-wr1-f66.google.com Received: from mail-wr1-f66.google.com (HELO mail-wr1-f66.google.com) (209.85.221.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 29 Nov 2018 16:48:25 +0000 Received: by mail-wr1-f66.google.com with SMTP id 96so2613747wrb.2 for ; Thu, 29 Nov 2018 08:48:21 -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=8d4fUwTgCtXLxNJGp3TH4NfAH2YHESGvD4pARn/AVT0=; b=Pg2AosPshrlyo8jazyG9xGkF+08vQ8kOGQWU00vvADWNlCHQswNTaq5YL7nS9nsW/G 071qTJ69ODbEJ3qnalPk0WuKcnSl3I/+lUhuWGamIe+dQ4Gp9y7N/9k07268Mp1RFyJ4 xKZwYHZge61c9Tqk9ubxH+smRpRZ90nK2Tbmt/DZi9SAWb4eJrEV2t9sGJkiC56S3Mn0 zVziMzR4bkVEKsRXVnhySHISSzie84F5/80Ko43y26koHkTiHH/shjHUwdDPhAMI51Os OzkKwtyizFdxD8K/rKYLPTgU51RBZWUBhzIqZU+o76JvHaHLDKDMj1UUKfgjERBs+F7R uAMw== Return-Path: Received: from localhost (host86-156-236-171.range86-156.btcentralplus.com. [86.156.236.171]) by smtp.gmail.com with ESMTPSA id j76sm1705410wmf.26.2018.11.29.08.48.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Nov 2018 08:48:18 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: jimw@sifive.com, palmer@sifive.com, jhb@FreeBSD.org, Andrew Burgess Subject: [PATCH 1/4] gdb/riscv: Make some target description functions constant Date: Thu, 29 Nov 2018 16:48:10 +0000 Message-Id: <31d92966588b71eefdd61411abbf3e196ad86e3f.1543509416.git.andrew.burgess@embecosm.com> In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes Makes more of the interface related to fetching target descriptions constant. gdb/ChangeLog: * arch/riscv.h (riscv_create_target_description): Make return type const. * arch/riscv.c (riscv_create_target_description): Likewise. * riscv-tdep.c (riscv_find_default_target_description): Likewise. --- gdb/ChangeLog | 7 +++++++ gdb/arch/riscv.c | 2 +- gdb/arch/riscv.h | 2 +- gdb/riscv-tdep.c | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gdb/arch/riscv.c b/gdb/arch/riscv.c index ca2238d5d70..cb715fabb1f 100644 --- a/gdb/arch/riscv.c +++ b/gdb/arch/riscv.c @@ -26,7 +26,7 @@ /* See arch/riscv.h. */ -target_desc * +const target_desc * riscv_create_target_description (struct riscv_gdbarch_features features) { target_desc *tdesc = allocate_target_description (); diff --git a/gdb/arch/riscv.h b/gdb/arch/riscv.h index 007944019a9..ec4d5f39525 100644 --- a/gdb/arch/riscv.h +++ b/gdb/arch/riscv.h @@ -58,7 +58,7 @@ struct riscv_gdbarch_features /* Create and return a target description that is compatible with FEATURES. */ -target_desc *riscv_create_target_description +const target_desc *riscv_create_target_description (struct riscv_gdbarch_features features); #endif /* ARCH_RISCV_H */ diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index 5965a594440..d66fe5c8793 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -2793,7 +2793,7 @@ static const struct frame_unwind riscv_frame_unwind = specifically the bfd object being executed, to guide the selection of a suitable default target description. */ -static struct target_desc * +static const struct target_desc * riscv_find_default_target_description (const struct gdbarch_info info) { struct riscv_gdbarch_features features;