[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

John Harrison via lldb-commits lldb-commits at lists.llvm.org
Thu May 1 17:13:29 PDT 2025


================
@@ -161,20 +161,22 @@ static void EventThreadFunction(DAP &dap) {
           case lldb::eStateSuspended:
             break;
           case lldb::eStateStopped:
-            // We launch and attach in synchronous mode then the first stop
-            // event will not be delivered. If we use "launchCommands" during a
-            // launch or "attachCommands" during an attach we might some process
-            // stop events which we do not want to send an event for. We will
-            // manually send a stopped event in request_configurationDone(...)
-            // so don't send any before then.
-            if (dap.configuration_done_sent) {
-              // Only report a stopped event if the process was not
-              // automatically restarted.
-              if (!lldb::SBProcess::GetRestartedFromEvent(event)) {
-                SendStdOutStdErr(dap, process);
+            {
+              std::unique_lock<std::mutex> lock(dap.ignore_stop_mutex);
+              if (dap.ignore_next_stop) {
+                DAP_LOG(dap.log, "Ignoring process stop event");
----------------
ashgti wrote:

Just curious, is there always precisely 1 stop event we should ignore? Or could multiple happen? For example, if we're running `attachCommands` or `launchCommands` could more than 1 stop event be triggered?

https://github.com/llvm/llvm-project/pull/138219


More information about the lldb-commits mailing list