PR 6878
[deliverable/binutils-gdb.git] / gdb / exceptions.c
index 89d14551a5709e61c28fde8a977ae9e894b1c767..f917c94ea16dd9b49ca2e737f03c6ee86fd38c99 100644 (file)
@@ -29,6 +29,7 @@
 #include "gdb_assert.h"
 #include "gdb_string.h"
 #include "serial.h"
+#include "gdbthread.h"
 
 const struct gdb_exception exception_none = { 0, GDB_NO_ERROR, NULL };
 
@@ -212,21 +213,21 @@ exceptions_state_mc_action_iter_1 (void)
 NORETURN void
 throw_exception (struct gdb_exception exception)
 {
+  struct thread_info *tp = NULL;
+
   quit_flag = 0;
   immediate_quit = 0;
 
+  if (!ptid_equal (inferior_ptid, null_ptid))
+    tp = find_thread_pid (inferior_ptid);
+
   /* Perhaps it would be cleaner to do this via the cleanup chain (not sure
      I can think of a reason why that is vital, though).  */
-  bpstat_clear_actions (stop_bpstat);  /* Clear queued breakpoint commands */
+  if (tp != NULL)
+    bpstat_clear_actions (tp->stop_bpstat);    /* Clear queued breakpoint commands */
 
   disable_current_display ();
   do_cleanups (ALL_CLEANUPS);
-  /* When we implement non-stop mode, this should be redone.  If we get
-     exception in a command pertaining to one thread, or maybe even not
-     involving inferior at all, we should not do exec cleanups for all
-     threads.  */
-  if (target_can_async_p () && !target_executing)
-    do_exec_cleanups (ALL_CLEANUPS);
 
   /* Jump to the containing catch_errors() call, communicating REASON
      to that call via setjmp's return value.  Note that REASON can't
This page took 0.024387 seconds and 4 git commands to generate.