public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: use 'const reggroup *' in python/py-registers.c file
@ 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=0ee336595924558bde5486becd83a9e4c40059ed
commit 0ee336595924558bde5486becd83a9e4c40059ed
Author: Andrew Burgess <aburgess@redhat.com>
Date: Thu Mar 31 13:03:41 2022 +0100
gdb: use 'const reggroup *' in python/py-registers.c file
Convert uses of 'struct reggroup *' in python/py-registers.c to be
'const'.
There should be no user visible changes after this commit.
Diff:
---
gdb/python/py-registers.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/gdb/python/py-registers.c b/gdb/python/py-registers.c
index 975eb2ca72d..41f6feab3c8 100644
--- a/gdb/python/py-registers.c
+++ b/gdb/python/py-registers.c
@@ -34,7 +34,7 @@ struct register_descriptor_iterator_object {
/* The register group that the user is iterating over. This will never
be NULL. */
- struct reggroup *reggroup;
+ const struct reggroup *reggroup;
/* The next register number to lookup. Starts at 0 and counts up. */
int regnum;
@@ -65,7 +65,7 @@ struct reggroup_iterator_object {
PyObject_HEAD
/* The last register group returned. Initially this will be NULL. */
- struct reggroup *reggroup;
+ const struct reggroup *reggroup;
/* Pointer back to the architecture we're finding registers for. */
struct gdbarch *gdbarch;
@@ -79,7 +79,7 @@ struct reggroup_object {
PyObject_HEAD
/* The register group being described. */
- struct reggroup *reggroup;
+ const struct reggroup *reggroup;
};
extern PyTypeObject reggroup_object_type
@@ -100,12 +100,12 @@ gdbpy_register_object_data_init (struct gdbarch *gdbarch)
returned for the same REGGROUP pointer. */
static gdbpy_ref<>
-gdbpy_get_reggroup (struct reggroup *reggroup)
+gdbpy_get_reggroup (const reggroup *reggroup)
{
/* Map from GDB's internal reggroup objects to the Python representation.
GDB's reggroups are global, and are never deleted, so using a map like
this is safe. */
- static std::unordered_map<struct reggroup *,gdbpy_ref<>>
+ static std::unordered_map<const struct reggroup *,gdbpy_ref<>>
gdbpy_reggroup_object_map;
/* If there is not already a suitable Python object in the map then
@@ -134,7 +134,7 @@ static PyObject *
gdbpy_reggroup_to_string (PyObject *self)
{
reggroup_object *group = (reggroup_object *) self;
- struct reggroup *reggroup = group->reggroup;
+ const reggroup *reggroup = group->reggroup;
const char *name = reggroup_name (reggroup);
return PyUnicode_FromString (name);
@@ -226,7 +226,7 @@ gdbpy_reggroup_iter_next (PyObject *self)
= (reggroup_iterator_object *) self;
struct gdbarch *gdbarch = iter_obj->gdbarch;
- struct reggroup *next_group = reggroup_next (gdbarch, iter_obj->reggroup);
+ const reggroup *next_group = reggroup_next (gdbarch, iter_obj->reggroup);
if (next_group == NULL)
{
PyErr_SetString (PyExc_StopIteration, _("No more groups"));
@@ -268,7 +268,7 @@ PyObject *
gdbpy_new_register_descriptor_iterator (struct gdbarch *gdbarch,
const char *group_name)
{
- struct reggroup *grp = NULL;
+ const reggroup *grp = NULL;
/* Lookup the requested register group, or find the default. */
if (group_name == NULL || *group_name == '\0')
^ 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: use 'const reggroup *' in python/py-registers.c file 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).