Do not load .eh_frame section from separete object files
[deliverable/binutils-gdb.git] / gdb / thread.c
index 5f07c83ff3b84aa9daa9d13d5804d0f387cde96e..5a78ad17025bced7ba304664f8ac2eff07b1058f 100644 (file)
@@ -45,6 +45,7 @@
 #include "cli/cli-decode.h"
 #include "gdb_regex.h"
 #include "cli/cli-utils.h"
+#include "continuations.h"
 
 /* Definition of struct thread_info exported to gdbthread.h.  */
 
@@ -124,8 +125,8 @@ clear_thread_inferior_resources (struct thread_info *tp)
 
   bpstat_clear (&tp->control.stop_bpstat);
 
-  discard_all_intermediate_continuations_thread (tp);
-  discard_all_continuations_thread (tp);
+  do_all_intermediate_continuations_thread (tp, 1);
+  do_all_continuations_thread (tp, 1);
 
   delete_longjmp_breakpoint (tp->num);
 }
@@ -133,8 +134,6 @@ clear_thread_inferior_resources (struct thread_info *tp)
 static void
 free_thread (struct thread_info *tp)
 {
-  clear_thread_inferior_resources (tp);
-
   if (tp->private)
     {
       if (tp->private_dtor)
@@ -296,15 +295,19 @@ delete_thread_1 (ptid_t ptid, int silent)
        return;
      }
 
+  /* Notify thread exit, but only if we haven't already.  */
+  if (tp->state_ != THREAD_EXITED)
+    observer_notify_thread_exit (tp, silent);
+
+  /* Tag it as exited.  */
+  tp->state_ = THREAD_EXITED;
+  clear_thread_inferior_resources (tp);
+
   if (tpprev)
     tpprev->next = tp->next;
   else
     thread_list = tp->next;
 
-  /* Notify thread exit, but only if we haven't already.  */
-  if (tp->state_ != THREAD_EXITED)
-    observer_notify_thread_exit (tp, silent);
-
   free_thread (tp);
 }
 
This page took 0.023874 seconds and 4 git commands to generate.