From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 3/4] Allow registry to refer to const types
Date: Fri, 10 Jun 2022 15:26:56 -0600 [thread overview]
Message-ID: <20220610212657.1170222-4-tom@tromey.com> (raw)
In-Reply-To: <20220610212657.1170222-1-tom@tromey.com>
So far, the registry hasn't been used to refer to a 'const' type, but
this changes with the gdbarch change. This patch arranges to let the
registry store a pointer-to-const, by removing const in the 'set'
method.
---
gdb/registry.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/registry.h b/gdb/registry.h
index f2d952ac847..036d424af61 100644
--- a/gdb/registry.h
+++ b/gdb/registry.h
@@ -116,7 +116,7 @@ class registry
void set (T *obj, DATA *data) const
{
registry<T> *reg_obj = registry_accessor<T>::get (obj);
- reg_obj->set (m_key, data);
+ reg_obj->set (m_key, (typename std::remove_const<DATA> *) data);
}
/* If this key uses the default deleter, then this method is
--
2.34.1
next prev parent reply other threads:[~2022-06-10 21:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-10 21:26 [PATCH 0/4] Rewrite gdbarch registry Tom Tromey
2022-06-10 21:26 ` [PATCH 1/4] Use bool in gdbarch Tom Tromey
2022-06-13 14:12 ` John Baldwin
2022-06-14 0:06 ` Tom Tromey
2022-06-10 21:26 ` [PATCH 2/4] Use new and delete for gdbarch Tom Tromey
2022-06-10 21:26 ` Tom Tromey [this message]
2022-06-10 21:26 ` [PATCH 4/4] Use registry in gdbarch Tom Tromey
2022-08-04 19:24 ` [PATCH 0/4] Rewrite gdbarch registry Tom Tromey
2022-08-05 16:50 ` Tsukasa OI via Gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220610212657.1170222-4-tom@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox