]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/linux-nat.c
gdb: Don't drop SIGSTOP during stop_all_threads
[thirdparty/binutils-gdb.git] / gdb / linux-nat.c
index 445b59fa4adadbb2890a9e2debffb5330f1e09e4..a07f41cf318f1fdc24e7d7f62b3cd75d2f47b709 100644 (file)
@@ -2527,17 +2527,23 @@ stop_wait_callback (struct lwp_info *lp, void *data)
        }
       else
        {
-         /* We caught the SIGSTOP that we intended to catch, so
-            there's no SIGSTOP pending.  */
+         /* We caught the SIGSTOP that we intended to catch.  */
 
          if (debug_linux_nat)
            fprintf_unfiltered (gdb_stdlog,
                                "SWC: Expected SIGSTOP caught for %s.\n",
                                target_pid_to_str (lp->ptid));
 
-         /* Reset SIGNALLED only after the stop_wait_callback call
-            above as it does gdb_assert on SIGNALLED.  */
          lp->signalled = 0;
+
+         /* If we are waiting for this stop so we can report the thread
+            stopped then we need to record this status.  Otherwise, we can
+            now discard this stop event.  */
+         if (lp->last_resume_kind == resume_stop)
+           {
+             lp->status = status;
+             save_stop_reason (lp);
+           }
        }
     }