diff options
author | David S. Miller <davem@redhat.com> | 2011-10-11 18:35:26 +0000 |
---|---|---|
committer | David S. Miller <davem@redhat.com> | 2011-10-11 18:35:26 +0000 |
commit | 349d138559111de9e0ee57120e267005ac27cb6e (patch) | |
tree | 75fb7faca70e31eff2ab8ef0b7c427ee51a9b3bb /gdb/regcache.c | |
parent | bfb6c1ab1ed502faa7c3764722a1f1661f6d44e8 (diff) | |
download | gdb-349d138559111de9e0ee57120e267005ac27cb6e.zip gdb-349d138559111de9e0ee57120e267005ac27cb6e.tar.gz gdb-349d138559111de9e0ee57120e267005ac27cb6e.tar.bz2 |
Fix regcache_restore() handling of unavailable regs.
* regcache.c (regcache_restore): Do not write unavailable regs, mark
static.
* regcache.h (regcache_restore): Remove declaration.
Diffstat (limited to 'gdb/regcache.c')
-rw-r--r-- | gdb/regcache.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/regcache.c b/gdb/regcache.c index 37092f8..ea8189e 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -331,7 +331,7 @@ regcache_save (struct regcache *dst, regcache_cooked_read_ftype *cooked_read, } } -void +static void regcache_restore (struct regcache *dst, regcache_cooked_read_ftype *cooked_read, void *cooked_read_context) @@ -351,9 +351,10 @@ regcache_restore (struct regcache *dst, { if (gdbarch_register_reggroup_p (gdbarch, regnum, restore_reggroup)) { - int valid = cooked_read (cooked_read_context, regnum, buf); + enum register_status status; - if (valid) + status = cooked_read (cooked_read_context, regnum, buf); + if (status == REG_VALID) regcache_cooked_write (dst, regnum, buf); } } |