aboutsummaryrefslogtreecommitdiff
path: root/gdb/progspace.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2013-10-21 16:31:17 +0800
committerYao Qi <yao@codesourcery.com>2013-11-20 12:41:25 +0800
commit3a8356ffac809056cb3650c50a00f4adb30cc147 (patch)
tree4cb0dadc6a7b290ee358e2cdb18c5bbf90adf69e /gdb/progspace.c
parentb12039c63764299237a899c986be7a557aa62807 (diff)
downloadgdb-3a8356ffac809056cb3650c50a00f4adb30cc147.zip
gdb-3a8356ffac809056cb3650c50a00f4adb30cc147.tar.gz
gdb-3a8356ffac809056cb3650c50a00f4adb30cc147.tar.bz2
Add REGISTRY for struct address_space.
This patch adds REGISTRY for struct address_space. gdb: 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.
Diffstat (limited to 'gdb/progspace.c')
-rw-r--r--gdb/progspace.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gdb/progspace.c b/gdb/progspace.c
index 6e72211..303e88e 100644
--- a/gdb/progspace.c
+++ b/gdb/progspace.c
@@ -44,17 +44,25 @@ static int highest_address_space_num;
DEFINE_REGISTRY (program_space, REGISTRY_ACCESS_FIELD)
-
-
-/* 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)
+
+
+
/* Create a new address space object, and add it to the list. */
struct address_space *
@@ -64,6 +72,7 @@ new_address_space (void)
aspace = XZALLOC (struct address_space);
aspace->num = ++highest_address_space_num;
+ address_space_alloc_data (aspace);
return aspace;
}
@@ -89,6 +98,7 @@ maybe_new_address_space (void)
static void
free_address_space (struct address_space *aspace)
{
+ address_space_free_data (aspace);
xfree (aspace);
}