aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/regcache.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2010-04-12 13:25:51 +0000
committerPedro Alves <palves@redhat.com>2010-04-12 13:25:51 +0000
commit45ba0d0206fe1872d8bc467268ffe3e9fe029ee2 (patch)
tree38511c90ef830b4746cf80abeb4cef5f31d993e6 /gdb/gdbserver/regcache.c
parent59e0401339359eb4a6d9fa51eb8c772ebae5bec6 (diff)
downloadgdb-45ba0d0206fe1872d8bc467268ffe3e9fe029ee2.zip
gdb-45ba0d0206fe1872d8bc467268ffe3e9fe029ee2.tar.gz
gdb-45ba0d0206fe1872d8bc467268ffe3e9fe029ee2.tar.bz2
* regcache.c (set_register_cache): Invalidate regcaches before
changing the register cache layout. (regcache_invalidate_one): Allow a NULL regcache. * linux-x86-low.c (x86_linux_update_xmltarget): Invalidate regcaches before changing the register cache layout or the target regsets.
Diffstat (limited to 'gdb/gdbserver/regcache.c')
-rw-r--r--gdb/gdbserver/regcache.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c
index 29fa2ff..9077a71 100644
--- a/gdb/gdbserver/regcache.c
+++ b/gdb/gdbserver/regcache.c
@@ -61,6 +61,9 @@ regcache_invalidate_one (struct inferior_list_entry *entry)
regcache = (struct regcache *) inferior_regcache_data (thread);
+ if (regcache == NULL)
+ return;
+
if (regcache->registers_valid)
{
struct thread_info *saved_inferior = current_inferior;
@@ -149,6 +152,10 @@ set_register_cache (struct reg *regs, int n)
{
int offset, i;
+ /* Before changing the register cache internal layout, flush the
+ contents of valid caches back to the threads. */
+ regcache_invalidate ();
+
reg_defs = regs;
num_registers = n;