diff options
author | Tom Tromey <tom@tromey.com> | 2022-06-01 15:31:15 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2022-08-04 13:28:04 -0600 |
commit | cb275538dbddfbb3c2c372a665ac48e6f617ea33 (patch) | |
tree | 7bc54ff4fc92c9b1cee74c2d7b9ae452b5ffec8b /gdb/gdbarch.py | |
parent | 8b1540430107b0752485ab9e6a841dbbacd45681 (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.py')
-rwxr-xr-x | gdb/gdbarch.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/gdbarch.py b/gdb/gdbarch.py index 5a261ba572..696b3028e6 100755 --- a/gdb/gdbarch.py +++ b/gdb/gdbarch.py @@ -261,6 +261,8 @@ with open("gdbarch.c", "w") as f: print(file=f) print(" /* An obstack bound to the lifetime of the architecture. */", file=f) print(" auto_obstack obstack;", file=f) + print(" /* Registry. */", file=f) + print(" registry<gdbarch> registry_fields;", file=f) print(file=f) print(" /* basic architectural information. */", file=f) for c in filter(info, components): @@ -296,8 +298,6 @@ with open("gdbarch.c", "w") as f: print("", file=f) print(" gdbarch = new struct gdbarch;", file=f) print(file=f) - print(" alloc_gdbarch_data (gdbarch);", file=f) - print(file=f) print(" gdbarch->tdep = tdep;", file=f) print(file=f) for c in filter(info, components): |