};
/* Record buf with core target. */
-static gdb_byte *record_full_core_regbuf = NULL;
+static detached_regcache *record_full_core_regbuf = NULL;
static struct target_section *record_full_core_start;
static struct target_section *record_full_core_end;
static struct record_full_core_buf_entry *record_full_core_buf_list = NULL;
/* Get record_full_core_regbuf. */
target_fetch_registers (regcache, -1);
- record_full_core_regbuf = (gdb_byte *) xmalloc (MAX_REGISTER_SIZE * regnum);
+ record_full_core_regbuf = new detached_regcache (regcache->arch (), false);
+
for (i = 0; i < regnum; i ++)
- regcache_raw_collect (regcache, i,
- record_full_core_regbuf + MAX_REGISTER_SIZE * i);
+ record_full_core_regbuf->raw_supply (i, *regcache);
/* Get record_full_core_start and record_full_core_end. */
if (build_section_table (core_bfd, &record_full_core_start,
&record_full_core_end))
{
- xfree (record_full_core_regbuf);
+ delete record_full_core_regbuf;
record_full_core_regbuf = NULL;
error (_("\"%s\": Can't find sections: %s"),
bfd_get_filename (core_bfd), bfd_errmsg (bfd_get_error ()));
/* Release record_full_core_regbuf. */
if (record_full_core_regbuf)
{
- xfree (record_full_core_regbuf);
+ delete record_full_core_regbuf;
record_full_core_regbuf = NULL;
}
int i;
for (i = 0; i < num; i ++)
- regcache_raw_supply (regcache, i,
- record_full_core_regbuf + MAX_REGISTER_SIZE * i);
+ regcache->raw_supply (i, *record_full_core_regbuf);
}
else
- regcache_raw_supply (regcache, regno,
- record_full_core_regbuf + MAX_REGISTER_SIZE * regno);
+ regcache->raw_supply (regno, *record_full_core_regbuf);
}
/* "to_prepare_to_store" method for prec over corefile. */
int regno)
{
if (record_full_gdb_operation_disable)
- regcache_raw_collect (regcache, regno,
- record_full_core_regbuf + MAX_REGISTER_SIZE * regno);
+ record_full_core_regbuf->raw_supply (regno, *regcache);
else
error (_("You can't do that without a process to debug."));
}