Rewrite registry.h
authorTom Tromey <tom@tromey.com>
Sun, 18 Oct 2020 17:38:10 +0000 (11:38 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 28 Jul 2022 20:16:50 +0000 (14:16 -0600)
commit08b8a139c9e8adcb4ec12a8a17e5836b8b5acb63
treee1050b58dcebee1150881f43f64c1c186955d240
parent8f83e7b9262e08fa43ca6e645337511c68ddc52a
Rewrite registry.h

This rewrites registry.h, removing all the macros and replacing it
with relatively ordinary template classes.  The result is less code
than the previous setup.  It replaces large macros with a relatively
straightforward C++ class, and now manages its own cleanup.

The existing type-safe "key" class is replaced with the equivalent
template class.  This approach ended up requiring relatively few
changes to the users of the registry code in gdb -- code using the key
system just required a small change to the key's declaration.

All existing users of the old C-like API are now converted to use the
type-safe API.  This mostly involved changing explicit deletion
functions to be an operator() in a deleter class.

The old "save/free" two-phase process is removed, and replaced with a
single "free" phase.  No existing code used both phases.

The old "free" callbacks took a parameter for the enclosing container
object.  However, this wasn't truly needed and is removed here as
well.
64 files changed:
gdb/Makefile.in
gdb/ada-lang.c
gdb/ada-tasks.c
gdb/arm-tdep.c
gdb/auto-load.c
gdb/auxv.c
gdb/break-catch-syscall.c
gdb/breakpoint.c
gdb/coffread.c
gdb/ctfread.c
gdb/dbxread.c
gdb/dwarf2/frame.c
gdb/dwarf2/read.c
gdb/elfread.c
gdb/fbsd-tdep.c
gdb/gdb-stabs.h
gdb/gdb_bfd.c
gdb/gdb_bfd.h
gdb/gdbtypes.c
gdb/guile/guile-internal.h
gdb/guile/scm-block.c
gdb/guile/scm-frame.c
gdb/guile/scm-objfile.c
gdb/guile/scm-progspace.c
gdb/guile/scm-symbol.c
gdb/guile/scm-symtab.c
gdb/guile/scm-type.c
gdb/hppa-tdep.c
gdb/inferior.c
gdb/inferior.h
gdb/inflow.c
gdb/linux-tdep.c
gdb/mdebugread.c
gdb/minidebug.c
gdb/nto-tdep.c
gdb/objc-lang.c
gdb/objfiles.c
gdb/objfiles.h
gdb/progspace.c
gdb/progspace.h
gdb/python/py-block.c
gdb/python/py-inferior.c
gdb/python/py-objfile.c
gdb/python/py-progspace.c
gdb/python/py-symbol.c
gdb/python/py-symtab.c
gdb/python/py-type.c
gdb/registry.c [deleted file]
gdb/registry.h
gdb/remote-sim.c
gdb/remote.c
gdb/rs6000-tdep.c
gdb/solib-aix.c
gdb/solib-darwin.c
gdb/solib-dsbt.c
gdb/solib-svr4.c
gdb/solib.c
gdb/source.c
gdb/stabsread.c
gdb/symfile-debug.c
gdb/symfile.c
gdb/symtab.c
gdb/target-dcache.c
gdb/xcoffread.c