From cb275538dbddfbb3c2c372a665ac48e6f617ea33 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 1 Jun 2022 15:31:15 -0600 Subject: 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. --- gdb/gdbarch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/gdbarch.c') 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 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; -- cgit v1.2.3