aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-09-10 16:21:03 +0000
committerDaniel Jacobowitz <drow@false.org>2006-09-10 16:21:03 +0000
commit5a2901d9edbe95aa5d59faf852bcded451d12a38 (patch)
tree2fd9ff1eee07fa0af10738b3f1fa96bc37595537
parent4c8508101163caf4d851d20d96dca2d77635b382 (diff)
downloadgdb-5a2901d9edbe95aa5d59faf852bcded451d12a38.zip
gdb-5a2901d9edbe95aa5d59faf852bcded451d12a38.tar.gz
gdb-5a2901d9edbe95aa5d59faf852bcded451d12a38.tar.bz2
PR threads/2149
* infrun.c (handle_inferior_event): Context switch after fork and exec events.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/infrun.c12
2 files changed, 18 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a652321..73ab067 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2006-09-10 Daniel Jacobowitz <dan@codesourcery.com>
+ PR threads/2149
+ * infrun.c (handle_inferior_event): Context switch after fork
+ and exec events.
+
+2006-09-10 Daniel Jacobowitz <dan@codesourcery.com>
+
* infcall.c (call_function_by_hand): Check for function pointer
types.
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 1c31a84..61afab2 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1411,6 +1411,12 @@ handle_inferior_event (struct execution_control_state *ecs)
pending_follow.fork_event.parent_pid = PIDGET (ecs->ptid);
pending_follow.fork_event.child_pid = ecs->ws.value.related_pid;
+ if (!ptid_equal (ecs->ptid, inferior_ptid))
+ {
+ context_switch (ecs);
+ flush_cached_frames ();
+ }
+
stop_pc = read_pc ();
stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid, 0);
@@ -1469,6 +1475,12 @@ handle_inferior_event (struct execution_control_state *ecs)
ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
inferior_ptid = ecs->saved_inferior_ptid;
+ if (!ptid_equal (ecs->ptid, inferior_ptid))
+ {
+ context_switch (ecs);
+ flush_cached_frames ();
+ }
+
/* If no catchpoint triggered for this, then keep going. */
if (ecs->random_signal)
{