PR threads/2149
authorDaniel Jacobowitz <drow@false.org>
Sun, 10 Sep 2006 16:21:03 +0000 (16:21 +0000)
committerDaniel Jacobowitz <drow@false.org>
Sun, 10 Sep 2006 16:21:03 +0000 (16:21 +0000)
* infrun.c (handle_inferior_event): Context switch after fork
and exec events.

gdb/ChangeLog
gdb/infrun.c

index a65232186dca16009b9a2f99c87864e8a10fa5b9..73ab0678e1ccef26b364435e54bd452cd169d252 100644 (file)
@@ -1,3 +1,9 @@
+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
index 1c31a846bb4b6b15e03390a47723036ffd864a16..61afab28a9245ad05b4b6a8baf3e68b127265d65 100644 (file)
@@ -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)
        {