aboutsummaryrefslogtreecommitdiff
path: root/gdb/regcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/regcache.c')
-rw-r--r--gdb/regcache.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gdb/regcache.c b/gdb/regcache.c
index f0ba0cf..a5c90a6 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -890,6 +890,17 @@ regcache_cooked_write_unsigned (struct regcache *regcache, int regnum,
regcache_cooked_write (regcache, regnum, buf);
}
+/* See regcache.h. */
+
+void
+regcache_raw_set_cached_value (struct regcache *regcache, int regnum,
+ const gdb_byte *buf)
+{
+ memcpy (register_buffer (regcache, regnum), buf,
+ regcache->descr->sizeof_register[regnum]);
+ regcache->register_status[regnum] = REG_VALID;
+}
+
void
regcache_raw_write (struct regcache *regcache, int regnum,
const gdb_byte *buf)
@@ -917,9 +928,7 @@ regcache_raw_write (struct regcache *regcache, int regnum,
inferior_ptid = regcache->ptid;
target_prepare_to_store (regcache);
- memcpy (register_buffer (regcache, regnum), buf,
- regcache->descr->sizeof_register[regnum]);
- regcache->register_status[regnum] = REG_VALID;
+ regcache_raw_set_cached_value (regcache, regnum, buf);
/* Register a cleanup function for invalidating the register after it is
written, in case of a failure. */