From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id EItxG/MYRmJQHAAAWB0awg (envelope-from ) for ; Thu, 31 Mar 2022 17:11:15 -0400 Received: by simark.ca (Postfix, from userid 112) id 6E3B01F163; Thu, 31 Mar 2022 17:11:15 -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 DFAB61E150 for ; Thu, 31 Mar 2022 17:11:14 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 99F893839430 for ; Thu, 31 Mar 2022 21:11:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99F893839430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1648761074; bh=gb7/AlFASh5iLPQXHTAboFBJa7JHLG6QrRzws0T7bOA=; 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=pBte2yVvKpRIY1kPBpm+JViC56JaVfeg+A2iAKUe6cLB7HvjSM+RElXnuvMs7LqJo 6o43YlvV67/65NZ12HMCRRuDx2NXStfZa8cazHrqhbKjb4TAUj8tcRbVhLuqVszQk8 6swkO/xBUPTc7MGEZZIZgibL2VRHEKVXo4VWh/ns= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 91ACE3888C53 for ; Thu, 31 Mar 2022 21:04:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 91ACE3888C53 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-433-wYP8L3H_NSyy-K6gozilCg-1; Thu, 31 Mar 2022 17:04:51 -0400 X-MC-Unique: wYP8L3H_NSyy-K6gozilCg-1 Received: by mail-wm1-f72.google.com with SMTP id i6-20020a1c5406000000b0038c97ed0db5so324017wmb.7 for ; Thu, 31 Mar 2022 14:04:51 -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=gb7/AlFASh5iLPQXHTAboFBJa7JHLG6QrRzws0T7bOA=; b=L1kQoE6ZPfSARDysGz0f9Wd6lUGnoFDEzzviweVR9QOxi89RB28qhVXZjwpFr8rE+P A4cDRj+JijWXzPCX4jL2ZdO0ApVwvCwI546xBEm0vXRz25JKQ5ixq2oKT28GJljuwSQ6 vsmYSqbHJmgkJT6bBy3RN9lCiRq3ADZ8DlMYwxG39wIj3O/WdhwkLS7PyffjQ8VA8IvJ pM3zgB7GL0F9oU3MGbSPpW8HksTequGcElGr9ngo+qsEAgXO6AuBbKQFK6u3/lkYhdYT 5LgoUpIhK/kPr7dgHpGlwt0xizdd0T0JbD5alegkDiERFCEzGqd1r19bQpZ4LnX/o51r xhew== X-Gm-Message-State: AOAM531YgpDcKDPveGvyApiGeMxeubOMbNp+VJBOAR/tCUweQKeHXjSt o7pHmQ2kNMPuyrTJJzJpJ+g+baQ6G0BAylP8l+0k29HQm0FphvZUlhW4QL0W7d3vLaclAlfD1f0 drg8pZiJygxfYgLlKj1MhCy+kkUUSQPoNbZxz+xt6Se25G+TViQ3/4bJ2TXOMVE0it11EHguiqw == X-Received: by 2002:a05:600c:1c20:b0:38c:ae37:c1ae with SMTP id j32-20020a05600c1c2000b0038cae37c1aemr6061374wms.203.1648760690313; Thu, 31 Mar 2022 14:04:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoLEwP0WX18VdhoZU4y46KrtMnn6vnTteRf2DOS08gzGZ1AiTZzB/2aVsj7BKX0QeU2MrF6w== X-Received: by 2002:a05:600c:1c20:b0:38c:ae37:c1ae with SMTP id j32-20020a05600c1c2000b0038cae37c1aemr6061359wms.203.1648760690018; Thu, 31 Mar 2022 14:04:50 -0700 (PDT) Received: from localhost (host86-169-131-113.range86-169.btcentralplus.com. [86.169.131.113]) by smtp.gmail.com with ESMTPSA id k18-20020a5d6d52000000b00203da94cf01sm411700wri.14.2022.03.31.14.04.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 14:04:49 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [PATCH 13/16] gdb: make the pre-defined register groups const Date: Thu, 31 Mar 2022 22:04:19 +0100 Message-Id: <45be7efb1cfd86e4ff45708d44b82660db8d6dd4.1648760270.git.aburgess@redhat.com> 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 f48260fbd93..04ecb8f9a17 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