+2010-01-28 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * 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.
+
2010-01-28 Joel Brobecker <brobecker@adacore.com>
Another -Wunused-function error in procfs.c (sparc-solaris)
struct regcache *
frame_save_as_regcache (struct frame_info *this_frame)
{
- struct regcache *regcache = regcache_xmalloc (get_frame_arch (this_frame));
+ struct address_space *aspace = get_frame_address_space (this_frame);
+ struct regcache *regcache = regcache_xmalloc (get_frame_arch (this_frame),
+ aspace);
struct cleanup *cleanups = make_cleanup_regcache_xfree (regcache);
regcache_save (regcache, do_frame_register_read, this_frame);
discard_cleanups (cleanups);
struct ppu2spu_cache *cache
= FRAME_OBSTACK_CALLOC (1, struct ppu2spu_cache);
- struct regcache *regcache = regcache_xmalloc (data.gdbarch);
+ struct address_space *aspace = get_frame_address_space (this_frame);
+ struct regcache *regcache = regcache_xmalloc (data.gdbarch, aspace);
struct cleanup *cleanups = make_cleanup_regcache_xfree (regcache);
regcache_save (regcache, ppu2spu_unwind_register, &data);
discard_cleanups (cleanups);
};
struct regcache *
-regcache_xmalloc (struct gdbarch *gdbarch)
+regcache_xmalloc (struct gdbarch *gdbarch, struct address_space *aspace)
{
struct regcache_descr *descr;
struct regcache *regcache;
= 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;
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)
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);
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;
}
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;
}
&& 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));