summaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-06-01 15:31:15 -0600
committerTom Tromey <tom@tromey.com>2022-08-04 13:28:04 -0600
commitcb275538dbddfbb3c2c372a665ac48e6f617ea33 (patch)
tree7bc54ff4fc92c9b1cee74c2d7b9ae452b5ffec8b /gdb/gdbarch.c
parent8b1540430107b0752485ab9e6a841dbbacd45681 (diff)
Use registry in gdbarch
gdbarch implements its own registry-like approach. This patch changes it to instead use registry.h. It's a rather large patch but largely uninteresting -- it's mostly a straightforward conversion from the old approach to the new one. The main benefit of this change is that it introduces type safety to the gdbarch registry. It also removes a bunch of code. One possible drawback is that, previously, the gdbarch registry differentiated between pre- and post-initialization setup. This doesn't seem very important to me, though.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 15897172f1..0edae7f6f0 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -34,6 +34,8 @@ struct gdbarch
/* An obstack bound to the lifetime of the architecture. */
auto_obstack obstack;
+ /* Registry. */
+ registry<gdbarch> registry_fields;
/* basic architectural information. */
const struct bfd_arch_info * bfd_arch_info;
@@ -264,8 +266,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
gdbarch = new struct gdbarch;
- alloc_gdbarch_data (gdbarch);
-
gdbarch->tdep = tdep;
gdbarch->bfd_arch_info = info->bfd_arch_info;