aboutsummaryrefslogtreecommitdiff
path: root/gdb/regcache.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2010-01-28 22:07:58 +0000
committerDaniel Jacobowitz <drow@false.org>2010-01-28 22:07:58 +0000
commitd37346f037e49c0ce3c4875a828fe1df85331638 (patch)
tree587e761e90c3c16a2c61c7c177a19d8fa5dc5159 /gdb/regcache.c
parent09be49c9dd141a814022c8302f9d1d57349a1eda (diff)
downloadgdb-d37346f037e49c0ce3c4875a828fe1df85331638.zip
gdb-d37346f037e49c0ce3c4875a828fe1df85331638.tar.gz
gdb-d37346f037e49c0ce3c4875a828fe1df85331638.tar.bz2
* regcache.c (regcache_xmalloc): Add aspace argument. Use it
for the new regcache. All callers updated. (regcache_cpy, regcache_cpy_no_passthrough): Do not set aspace here. (get_thread_arch_regcache): Do not set aspace here. * regcache.h (regcache_xmalloc): Update declaration. * frame.c, infcall.c, ppc-linux-tdep.c: Calls to regcache_xmalloc updated.
Diffstat (limited to 'gdb/regcache.c')
-rw-r--r--gdb/regcache.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 974eada..d6f58fe 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -212,7 +212,7 @@ struct regcache
};
struct regcache *
-regcache_xmalloc (struct gdbarch *gdbarch)
+regcache_xmalloc (struct gdbarch *gdbarch, struct address_space *aspace)
{
struct regcache_descr *descr;
struct regcache *regcache;
@@ -224,7 +224,7 @@ regcache_xmalloc (struct gdbarch *gdbarch)
= XCALLOC (descr->sizeof_raw_registers, gdb_byte);
regcache->register_valid_p
= XCALLOC (descr->sizeof_raw_register_valid_p, gdb_byte);
- regcache->aspace = NULL;
+ regcache->aspace = aspace;
regcache->readonly_p = 1;
regcache->ptid = minus_one_ptid;
return regcache;
@@ -358,8 +358,6 @@ regcache_cpy (struct regcache *dst, struct regcache *src)
gdb_assert (src != dst);
gdb_assert (src->readonly_p || dst->readonly_p);
- dst->aspace = src->aspace;
-
if (!src->readonly_p)
regcache_save (dst, do_cooked_read, src);
else if (!dst->readonly_p)
@@ -379,7 +377,6 @@ regcache_cpy_no_passthrough (struct regcache *dst, struct regcache *src)
silly - it would mean that valid_p would be completely invalid. */
gdb_assert (dst->readonly_p);
- dst->aspace = src->aspace;
memcpy (dst->registers, src->registers, dst->descr->sizeof_raw_registers);
memcpy (dst->register_valid_p, src->register_valid_p,
dst->descr->sizeof_raw_register_valid_p);
@@ -389,7 +386,7 @@ struct regcache *
regcache_dup (struct regcache *src)
{
struct regcache *newbuf;
- newbuf = regcache_xmalloc (src->descr->gdbarch);
+ newbuf = regcache_xmalloc (src->descr->gdbarch, get_regcache_aspace (src));
regcache_cpy (newbuf, src);
return newbuf;
}
@@ -398,7 +395,7 @@ struct regcache *
regcache_dup_no_passthrough (struct regcache *src)
{
struct regcache *newbuf;
- newbuf = regcache_xmalloc (src->descr->gdbarch);
+ newbuf = regcache_xmalloc (src->descr->gdbarch, get_regcache_aspace (src));
regcache_cpy_no_passthrough (newbuf, src);
return newbuf;
}
@@ -453,10 +450,10 @@ get_thread_arch_regcache (ptid_t ptid, struct gdbarch *gdbarch)
&& get_regcache_arch (list->regcache) == gdbarch)
return list->regcache;
- new_regcache = regcache_xmalloc (gdbarch);
+ new_regcache = regcache_xmalloc (gdbarch,
+ target_thread_address_space (ptid));
new_regcache->readonly_p = 0;
new_regcache->ptid = ptid;
- new_regcache->aspace = target_thread_address_space (ptid);
gdb_assert (new_regcache->aspace != NULL);
list = xmalloc (sizeof (struct regcache_list));