forked from Imagelibrary/binutils-gdb
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.
This commit is contained in:
@@ -123,7 +123,7 @@ struct arm_per_bfd
|
||||
};
|
||||
|
||||
/* Per-bfd data used for mapping symbols. */
|
||||
static bfd_key<arm_per_bfd> arm_bfd_data_key;
|
||||
static const registry<bfd>::key<arm_per_bfd> arm_bfd_data_key;
|
||||
|
||||
/* The list of available "set arm ..." and "show arm ..." commands. */
|
||||
static struct cmd_list_element *setarmcmdlist = NULL;
|
||||
@@ -2407,7 +2407,7 @@ struct arm_exidx_data
|
||||
};
|
||||
|
||||
/* Per-BFD key to store exception handling information. */
|
||||
static const struct bfd_key<arm_exidx_data> arm_exidx_data_key;
|
||||
static const registry<bfd>::key<arm_exidx_data> arm_exidx_data_key;
|
||||
|
||||
static struct obj_section *
|
||||
arm_obj_section_from_vma (struct objfile *objfile, bfd_vma vma)
|
||||
|
||||
Reference in New Issue
Block a user