aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-11-20 17:06:05 +0000
committerPedro Alves <palves@redhat.com>2008-11-20 17:06:05 +0000
commitc7e8a53cdd5cd68ded1e80c52a691791fb28a0e4 (patch)
tree943c061d08c443e3e661e81d529650256968fd2f /gdb
parente2fd701eb4e8c8e59741a6a5ae97d759e70e239a (diff)
downloadgdb-c7e8a53cdd5cd68ded1e80c52a691791fb28a0e4.zip
gdb-c7e8a53cdd5cd68ded1e80c52a691791fb28a0e4.tar.gz
gdb-c7e8a53cdd5cd68ded1e80c52a691791fb28a0e4.tar.bz2
* infrun.c (resume): If following a fork, also reset regcache,
gdbarch and pc.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/infrun.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 89f352d..3d8d441 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-20 Pedro Alves <pedro@codesourcery.com>
+
+ * infrun.c (resume): If following a fork, also reset regcache,
+ gdbarch and pc.
+
2008-11-20 Doug Evans <dje@google.com>
* printcmd.c (sym_info): Don't print the offset if it's zero.
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 93ee00b..4043e75 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -965,10 +965,13 @@ resume (int step, enum target_signal sig)
{
int should_resume = 1;
struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0);
+
+ /* Note that these must be reset if we follow a fork below. */
struct regcache *regcache = get_current_regcache ();
struct gdbarch *gdbarch = get_regcache_arch (regcache);
struct thread_info *tp = inferior_thread ();
CORE_ADDR pc = regcache_read_pc (regcache);
+
QUIT;
if (debug_infrun)
@@ -1057,6 +1060,9 @@ a command like `return' or `jump' to continue execution."));
/* Following a child fork will change our notion of current
thread. */
tp = inferior_thread ();
+ regcache = get_current_regcache ();
+ gdbarch = get_regcache_arch (regcache);
+ pc = regcache_read_pc (regcache);
break;
case TARGET_WAITKIND_EXECD: