+2013-11-20 Yao Qi <yao@codesourcery.com>
+
+ * progspace.c (struct address_space): Update comments.
+ <REGISTRY_FIELDS>: New fields.
+ DEFINE_REGISTRY for address_space.
+ (new_address_space): Call address_space_alloc_data.
+ (free_address_space): Call address_space_free_data.
+ * progspace.h: Use DECLARE_REGISTRY.
+
2013-11-20 Yao Qi <yao@codesourcery.com>
* Makefile.in (SFILES):Add target-dcache.c.
DEFINE_REGISTRY (program_space, REGISTRY_ACCESS_FIELD)
-\f
-
-/* An address space. Currently this is not used for much other than
- for comparing if pspaces/inferior/threads see the same address
+/* An address space. It is used for comparing if pspaces/inferior/threads
+ see the same address space and for associating caches to each address
space. */
struct address_space
{
int num;
+
+ /* Per aspace data-pointers required by other GDB modules. */
+ REGISTRY_FIELDS;
};
+/* Keep a registry of per-address_space data-pointers required by other GDB
+ modules. */
+
+DEFINE_REGISTRY (address_space, REGISTRY_ACCESS_FIELD)
+
+\f
+
/* Create a new address space object, and add it to the list. */
struct address_space *
aspace = XZALLOC (struct address_space);
aspace->num = ++highest_address_space_num;
+ address_space_alloc_data (aspace);
return aspace;
}
static void
free_address_space (struct address_space *aspace)
{
+ address_space_free_data (aspace);
xfree (aspace);
}
DECLARE_REGISTRY (program_space);
+/* Keep a registry of per-aspace data-pointers required by other GDB
+ modules. */
+
+DECLARE_REGISTRY (address_space);
+
#endif