aboutsummaryrefslogtreecommitdiff
path: root/gdb/regcache.c
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2017-02-27 09:58:35 +0000
committerAlan Hayward <alan.hayward@arm.com>2017-02-27 09:58:35 +0000
commit8e3681243c642d667164bd23ae9a376620da0780 (patch)
treea2311ff7b18870d84e8685aabc08d85692067c09 /gdb/regcache.c
parenta0aa382843fc5ccbeebf99d8d3c3075ca13e8125 (diff)
downloadfsf-binutils-gdb-8e3681243c642d667164bd23ae9a376620da0780.zip
fsf-binutils-gdb-8e3681243c642d667164bd23ae9a376620da0780.tar.gz
fsf-binutils-gdb-8e3681243c642d667164bd23ae9a376620da0780.tar.bz2
Remove MAX_REGISTER_SIZE from remote.c
gdb/ * regcache.c (regcache_raw_update): New function. (regcache_raw_read): Move code to regcache_raw_update. * regcache.h (regcache_raw_update): New declaration. * remote.c (remote_prepare_to_store): Call regcache_raw_update.
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 eed1bd8..0728a03 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -642,15 +642,17 @@ registers_changed (void)
alloca (0);
}
-enum register_status
-regcache_raw_read (struct regcache *regcache, int regnum, gdb_byte *buf)
+void
+regcache_raw_update (struct regcache *regcache, int regnum)
{
- gdb_assert (regcache != NULL && buf != NULL);
+ gdb_assert (regcache != NULL);
gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
+
/* Make certain that the register cache is up-to-date with respect
to the current thread. This switching shouldn't be necessary
only there is still only one target side register cache. Sigh!
On the bright side, at least there is a regcache object. */
+
if (!regcache->readonly_p
&& regcache_register_status (regcache, regnum) == REG_UNKNOWN)
{
@@ -666,6 +668,13 @@ regcache_raw_read (struct regcache *regcache, int regnum, gdb_byte *buf)
if (regcache->register_status[regnum] == REG_UNKNOWN)
regcache->register_status[regnum] = REG_UNAVAILABLE;
}
+}
+
+enum register_status
+regcache_raw_read (struct regcache *regcache, int regnum, gdb_byte *buf)
+{
+ gdb_assert (buf != NULL);
+ regcache_raw_update (regcache, regnum);
if (regcache->register_status[regnum] != REG_VALID)
memset (buf, 0, regcache->descr->sizeof_register[regnum]);