From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KNIbCKWDTWLSMAAAWB0awg (envelope-from ) for ; Wed, 06 Apr 2022 08:12:21 -0400 Received: by simark.ca (Postfix, from userid 112) id 1F3851F344; Wed, 6 Apr 2022 08:12:21 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9C6351E787 for ; Wed, 6 Apr 2022 08:12:20 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 55C853858016 for ; Wed, 6 Apr 2022 12:12:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 55C853858016 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1649247140; bh=Ra8go3wAeSz6y70s/mAQqlp58WHMC+vC/6BL2dmuyNc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=aq4DEDTJd69ncp/6wpii8r6k8vDFLdJ2C1h4OJDTqtNewORG2ctj1f0YXAxiHfoAB vcRdiiU7TNL2qsT0BarhmKjMYGPXBA/q/V/0QInzJZX9w58hdeDgt3Zqjw2ynAnHql G1RyC8W/TTkiwHGSuqTk5j36/1bOtbrM3I+fWRrg= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 3D002385843E for ; Wed, 6 Apr 2022 12:05:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3D002385843E Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-46-6GZ6NnsLPRCwMwWRQj0mMA-1; Wed, 06 Apr 2022 08:05:19 -0400 X-MC-Unique: 6GZ6NnsLPRCwMwWRQj0mMA-1 Received: by mail-wr1-f71.google.com with SMTP id r16-20020adfbb10000000b002060d469943so427037wrg.4 for ; Wed, 06 Apr 2022 05:05:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ra8go3wAeSz6y70s/mAQqlp58WHMC+vC/6BL2dmuyNc=; b=vVmq9PiRI6AuvuQVsaioE8MUPUXrDOPPdv9TiDZO5xaE+UARGG/rNK34q3s+ISjE/x 4bYwng/XRTADJhwyuArrF51JRN795yrOTf+D9jWsTJcWn9DIWZVuzoafyAkqiakA1WnZ hU3A9T+nioVwRPo3FlAPCsKb1BBgYWTfBZA2osULhPKDhBbPww0JFBrr18lsVJKjEBSx j8Q6nI//HfkoxQKysm4ahrxmNfpciVVzAbqrCDoApO22qViuvC3FkQa6gHV9o44W8rmq B1lX3aYByVPMGLXfW+jR9uHgzwAGCYnH1xtNY4KotqLplypV51cnRPm34f/fu37HEkq2 l03Q== X-Gm-Message-State: AOAM5315xKj8qxbNiH7wdlDt9UCtG/3uCBFt4lKgKAmZ3EINAjCtwvpv r+VAJPs/XkxFq7o/qHpQxEgRl1Exmf8i3Icoew6y2SluubzcT4+yP9Gv8Se4U3QBj/y2dwW07zI tNlDe3n3oo0ngLHCjXrd8XKUBhWc06zO+Vr9JxQPhNfqxyqdTrGJlo/7orEs0a276/LEz5Q1bhQ == X-Received: by 2002:a5d:64c8:0:b0:204:ccc:4ba5 with SMTP id f8-20020a5d64c8000000b002040ccc4ba5mr6489226wri.409.1649246718317; Wed, 06 Apr 2022 05:05:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzX9WBKbAEp09XFqtvcZd0gIPx6ZWGPY3YqPSMvkkSKp9jD8scg2Jzqr7aHt+VPw74Za9R9MQ== X-Received: by 2002:a5d:64c8:0:b0:204:ccc:4ba5 with SMTP id f8-20020a5d64c8000000b002040ccc4ba5mr6489201wri.409.1649246718020; Wed, 06 Apr 2022 05:05:18 -0700 (PDT) Received: from localhost (host86-169-131-113.range86-169.btcentralplus.com. [86.169.131.113]) by smtp.gmail.com with ESMTPSA id p19-20020a05600c359300b0038c7d1086a7sm5209539wmq.1.2022.04.06.05.05.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:05:16 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [PATCHv2 13/16] gdb: make the pre-defined register groups const Date: Wed, 6 Apr 2022 13:04:46 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Cc: Andrew Burgess Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Convert the 7 global, pre-defined, register groups const, and fix the fall out (a minor tweak required in riscv-tdep.c). There should be no user visible changes after this commit. --- gdb/reggroups.c | 30 +++++++++++++++--------------- gdb/reggroups.h | 14 +++++++------- gdb/riscv-tdep.c | 2 +- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/gdb/reggroups.c b/gdb/reggroups.c index 419e091c3c0..2888704f2d2 100644 --- a/gdb/reggroups.c +++ b/gdb/reggroups.c @@ -254,21 +254,21 @@ maintenance_print_reggroups (const char *args, int from_tty) } /* Pre-defined register groups. */ -static struct reggroup general_group = { "general", USER_REGGROUP }; -static struct reggroup float_group = { "float", USER_REGGROUP }; -static struct reggroup system_group = { "system", USER_REGGROUP }; -static struct reggroup vector_group = { "vector", USER_REGGROUP }; -static struct reggroup all_group = { "all", USER_REGGROUP }; -static struct reggroup save_group = { "save", INTERNAL_REGGROUP }; -static struct reggroup restore_group = { "restore", INTERNAL_REGGROUP }; - -struct reggroup *const general_reggroup = &general_group; -struct reggroup *const float_reggroup = &float_group; -struct reggroup *const system_reggroup = &system_group; -struct reggroup *const vector_reggroup = &vector_group; -struct reggroup *const all_reggroup = &all_group; -struct reggroup *const save_reggroup = &save_group; -struct reggroup *const restore_reggroup = &restore_group; +static const reggroup general_group = { "general", USER_REGGROUP }; +static const reggroup float_group = { "float", USER_REGGROUP }; +static const reggroup system_group = { "system", USER_REGGROUP }; +static const reggroup vector_group = { "vector", USER_REGGROUP }; +static const reggroup all_group = { "all", USER_REGGROUP }; +static const reggroup save_group = { "save", INTERNAL_REGGROUP }; +static const reggroup restore_group = { "restore", INTERNAL_REGGROUP }; + +const reggroup *const general_reggroup = &general_group; +const reggroup *const float_reggroup = &float_group; +const reggroup *const system_reggroup = &system_group; +const reggroup *const vector_reggroup = &vector_group; +const reggroup *const all_reggroup = &all_group; +const reggroup *const save_reggroup = &save_group; +const reggroup *const restore_reggroup = &restore_group; void _initialize_reggroup (); void diff --git a/gdb/reggroups.h b/gdb/reggroups.h index 28bd00ff176..ec1d79dfc30 100644 --- a/gdb/reggroups.h +++ b/gdb/reggroups.h @@ -28,15 +28,15 @@ struct reggroup; enum reggroup_type { USER_REGGROUP, INTERNAL_REGGROUP }; /* Pre-defined, user visible, register groups. */ -extern struct reggroup *const general_reggroup; -extern struct reggroup *const float_reggroup; -extern struct reggroup *const system_reggroup; -extern struct reggroup *const vector_reggroup; -extern struct reggroup *const all_reggroup; +extern const reggroup *const general_reggroup; +extern const reggroup *const float_reggroup; +extern const reggroup *const system_reggroup; +extern const reggroup *const vector_reggroup; +extern const reggroup *const all_reggroup; /* Pre-defined, internal, register groups. */ -extern struct reggroup *const save_reggroup; -extern struct reggroup *const restore_reggroup; +extern const reggroup *const save_reggroup; +extern const reggroup *const restore_reggroup; /* Create a new local register group. */ extern const reggroup *reggroup_new (const char *name, diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index ab239744393..69f2123dcdb 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -1369,7 +1369,7 @@ riscv_print_registers_info (struct gdbarch *gdbarch, } else { - struct reggroup *reggroup; + const struct reggroup *reggroup; if (print_all) reggroup = all_reggroup; -- 2.25.4