aboutsummaryrefslogtreecommitdiff
path: root/gdb/corelow.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2009-05-18 12:12:16 +0000
committerPedro Alves <palves@redhat.com>2009-05-18 12:12:16 +0000
commit739fc47ac9a6169d7b12e82a3ec6ce8472354f78 (patch)
tree981cb0f4f389a95cd4828c805aa58be9ab943720 /gdb/corelow.c
parent7e1789f556ec6ba5c736abcb81e0a08ba31673ab (diff)
downloadfsf-binutils-gdb-739fc47ac9a6169d7b12e82a3ec6ce8472354f78.zip
fsf-binutils-gdb-739fc47ac9a6169d7b12e82a3ec6ce8472354f78.tar.gz
fsf-binutils-gdb-739fc47ac9a6169d7b12e82a3ec6ce8472354f78.tar.bz2
* corelow.c (core_open): Flush the register cache before doing
anything with registers.
Diffstat (limited to 'gdb/corelow.c')
-rw-r--r--gdb/corelow.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 5d6f072..ffaf04c 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -379,6 +379,14 @@ core_open (char *filename, int from_tty)
from ST to MT. */
add_thread_silent (inferior_ptid);
+ /* Need to flush the register cache (and the frame cache) from a
+ previous debug session. If inferior_ptid ends up the same as the
+ last debug session --- e.g., b foo; run; gcore core1; step; gcore
+ core2; core core1; core core2 --- then there's potential for
+ get_current_regcache to return the cached regcache of the
+ previous session, and the frame cache being stale. */
+ registers_changed ();
+
/* Build up thread list from BFD sections, and possibly set the
current thread to the .reg/NN section matching the .reg
section. */