diff options
author | Michael Snyder <msnyder@specifix.com> | 2001-08-10 21:52:17 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@specifix.com> | 2001-08-10 21:52:17 +0000 |
commit | b8e9b5c7018dbb63275f2e777cf1067bee458aa9 (patch) | |
tree | 55b0fe2032111583b742d3f3cf20980da46447c8 /gdb/regcache.c | |
parent | 93d94243e7ffd2ac2e77b5101302619880942376 (diff) | |
download | gdb-b8e9b5c7018dbb63275f2e777cf1067bee458aa9.tar.gz |
2001-08-10 Michael Snyder <msnyder@redhat.com>
* regcache.c (legacy_write_register_gen): Don't 'optimize out'
a write_register to a pseudo-reg. Target_store_pseudo_register
needs to get called, because these regs may be computed and may
have side-effects.
Diffstat (limited to 'gdb/regcache.c')
-rw-r--r-- | gdb/regcache.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gdb/regcache.c b/gdb/regcache.c index b939d9a8fb1..ffd13bf8a4b 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -334,15 +334,16 @@ legacy_write_register_gen (int regnum, char *myaddr) size = REGISTER_RAW_SIZE (regnum); - /* If we have a valid copy of the register, and new value == old value, - then don't bother doing the actual store. */ - - if (register_cached (regnum) - && memcmp (register_buffer (regnum), myaddr, size) == 0) - return; - if (real_register (regnum)) - target_prepare_to_store (); + { + /* If we have a valid copy of the register, and new value == old + value, then don't bother doing the actual store. */ + if (register_cached (regnum) + && memcmp (register_buffer (regnum), myaddr, size) == 0) + return; + else + target_prepare_to_store (); + } memcpy (register_buffer (regnum), myaddr, size); |