* infrun.c (handle_inferior_event): Tag threads as stopped
authorLuis Machado <luisgpm@br.ibm.com>
Tue, 15 Jul 2008 17:25:21 +0000 (17:25 +0000)
committerLuis Machado <luisgpm@br.ibm.com>
Tue, 15 Jul 2008 17:25:21 +0000 (17:25 +0000)
before inserting breakpoints.

gdb/ChangeLog
gdb/infrun.c

index 883c44d296f2ef69e1ec36140d2e77b2f645a84d..f4112195f93b3b5b21609dd10382639d6ee91cf8 100644 (file)
@@ -1,3 +1,8 @@
+2008-07-15  Luis Machado  <luisgpm@br.ibm.com>
+
+       * infrun.c (handle_inferior_event): Tag threads as stopped
+       before inserting breakpoints.
+
 2008-07-15  Hui Zhu  <teawater@gmail.com>
 
        * MAINTAINERS: Added myself to section Write After Approval.
index 410c6dd384f9ebc77976bdebbdf3f9df18d202c3..2f32a82b5ba68332958e06d8330172fa7f187fb3 100644 (file)
@@ -1828,6 +1828,29 @@ handle_inferior_event (struct execution_control_state *ecs)
 
   adjust_pc_after_break (ecs);
 
+  reinit_frame_cache ();
+
+  /* If it's a new process, add it to the thread database */
+
+  ecs->new_thread_event = (!ptid_equal (ecs->ptid, inferior_ptid)
+                          && !ptid_equal (ecs->ptid, minus_one_ptid)
+                          && !in_thread_list (ecs->ptid));
+
+  if (ecs->ws.kind != TARGET_WAITKIND_EXITED
+      && ecs->ws.kind != TARGET_WAITKIND_SIGNALLED && ecs->new_thread_event)
+    add_thread (ecs->ptid);
+
+  if (ecs->ws.kind != TARGET_WAITKIND_IGNORE)
+    {
+      /* 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);
+    }
+
   switch (infwait_state)
     {
     case infwait_thread_hop_state:
@@ -1867,29 +1890,6 @@ handle_inferior_event (struct execution_control_state *ecs)
     }
   infwait_state = infwait_normal_state;
 
-  reinit_frame_cache ();
-
-  /* If it's a new process, add it to the thread database */
-
-  ecs->new_thread_event = (!ptid_equal (ecs->ptid, inferior_ptid)
-                          && !ptid_equal (ecs->ptid, minus_one_ptid)
-                          && !in_thread_list (ecs->ptid));
-
-  if (ecs->ws.kind != TARGET_WAITKIND_EXITED
-      && ecs->ws.kind != TARGET_WAITKIND_SIGNALLED && ecs->new_thread_event)
-    add_thread (ecs->ptid);
-
-  if (ecs->ws.kind != TARGET_WAITKIND_IGNORE)
-    {
-      /* 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);
-    }
-
   switch (ecs->ws.kind)
     {
     case TARGET_WAITKIND_LOADED: