* infrun.c (handle_inferior_event): Correctly tag non-executing
authorPedro Alves <palves@redhat.com>
Fri, 12 Dec 2008 14:20:48 +0000 (14:20 +0000)
committerPedro Alves <palves@redhat.com>
Fri, 12 Dec 2008 14:20:48 +0000 (14:20 +0000)
threads in multi-process.
(normal_stop): Correctly tag stopped threads in multi-process.

gdb/ChangeLog
gdb/infrun.c

index 88f234118bb90b376bc7f68e8bbb6ba09c2d223c..9e8f9a5a7b75dcb32455a98ec2dc5af39eb24367 100644 (file)
@@ -1,3 +1,9 @@
+2008-12-12  Pedro Alves  <pedro@codesourcery.com>
+
+       * infrun.c (handle_inferior_event): Correctly tag non-executing
+       threads in multi-process.
+       (normal_stop): Correctly tag stopped threads in multi-process.
+
 2008-12-12  Pedro Alves  <pedro@codesourcery.com>
 
        * remote.c (extended_remote_mourn_1): Always call
index e65704a06b23dab36d898f7b55c1b47257a84b14..eb2528ce7b9d771bf431f2b5f13185396645ddf0 100644 (file)
@@ -2141,13 +2141,17 @@ handle_inferior_event (struct execution_control_state *ecs)
     {
       breakpoint_retire_moribund ();
 
-      /* Mark the non-executing threads accordingly.  */
-      if (!non_stop
-         || ecs->ws.kind == TARGET_WAITKIND_EXITED
-         || ecs->ws.kind == TARGET_WAITKIND_SIGNALLED)
-       set_executing (pid_to_ptid (-1), 0);
-      else
-       set_executing (ecs->ptid, 0);
+      /* Mark the non-executing threads accordingly.  In all-stop, all
+        threads of all processes are stopped when we get any event
+        reported.  In non-stop mode, only the event thread stops.  If
+        we're handling a process exit in non-stop mode, there's
+        nothing to do, as threads of the dead process are gone, and
+        threads of any other process were left running.  */
+      if (!non_stop)
+       set_executing (minus_one_ptid, 0);
+      else if (ecs->ws.kind != TARGET_WAITKIND_SIGNALLED
+              && ecs->ws.kind != TARGET_WAITKIND_EXITED)
+       set_executing (inferior_ptid, 0);
     }
 
   switch (infwait_state)
@@ -4372,17 +4376,25 @@ done:
       else
        observer_notify_normal_stop (NULL);
     }
-  if (target_has_execution
-      && last.kind != TARGET_WAITKIND_SIGNALLED
-      && last.kind != TARGET_WAITKIND_EXITED)
-    {
-      /* Delete the breakpoint we stopped at, if it wants to be deleted.
-        Delete any breakpoint that is to be deleted at the next stop.  */
-      breakpoint_auto_delete (inferior_thread ()->stop_bpstat);
 
+  if (target_has_execution)
+    {
+      if (last.kind != TARGET_WAITKIND_SIGNALLED
+         && last.kind != TARGET_WAITKIND_EXITED)
+       /* Delete the breakpoint we stopped at, if it wants to be deleted.
+          Delete any breakpoint that is to be deleted at the next stop.  */
+       breakpoint_auto_delete (inferior_thread ()->stop_bpstat);
+
+      /* Mark the stopped threads accordingly.  In all-stop, all
+        threads of all processes are stopped when we get any event
+        reported.  In non-stop mode, only the event thread stops.  If
+        we're handling a process exit in non-stop mode, there's
+        nothing to do, as threads of the dead process are gone, and
+        threads of any other process were left running.  */
       if (!non_stop)
-       set_running (pid_to_ptid (-1), 0);
-      else
+       set_running (minus_one_ptid, 0);
+      else if (last.kind != TARGET_WAITKIND_SIGNALLED
+              && last.kind != TARGET_WAITKIND_EXITED)
        set_running (inferior_ptid, 0);
     }
 
This page took 0.043009 seconds and 4 git commands to generate.