]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Merge from head:
authorPedro Alves <palves@redhat.com>
Tue, 16 Dec 2008 22:54:36 +0000 (22:54 +0000)
committerPedro Alves <palves@redhat.com>
Tue, 16 Dec 2008 22:54:36 +0000 (22:54 +0000)
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.

gdb/ChangeLog.mp
gdb/infrun.c

index c1fc365df93c8d9cdd9305f31afe33630f4528d8..75c58d33938500065f4113449a8b9588ce6f23e8 100644 (file)
@@ -1,3 +1,12 @@
+2008-12-16  Pedro Alves  <pedro@codesourcery.com>
+
+       Merge from head:
+       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-16  Pedro Alves  <pedro@codesourcery.com>
 
        Merge from head:
index 1019f1baeb974836669d0d21c8d3d3c5b3aa4e0b..85f58ecb7115c9b3f96b6454b703944d556981f9 100644 (file)
@@ -2135,13 +2135,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)
@@ -4371,17 +4375,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);
     }