public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: make the pre-defined register groups const
@ 2022-04-07 15:08 Andrew Burgess
0 siblings, 0 replies; only message in thread
From: Andrew Burgess @ 2022-04-07 15:08 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3a471c03b06289033972e7d4e72b392e3749a199
commit 3a471c03b06289033972e7d4e72b392e3749a199
Author: Andrew Burgess <aburgess@redhat.com>
Date: Thu Mar 31 16:36:21 2022 +0100
gdb: make the pre-defined register groups const
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.
Diff:
---
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 bb8a83f7653..24c45257efc 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 8ac372574be..2f38b67e9a2 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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-04-07 15:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07 15:08 [binutils-gdb] gdb: make the pre-defined register groups const Andrew Burgess
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).