llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

<details>
<summary>Changes</summary>

DAP::WaitForProcessToStop treats the process in eStateUnloaded as an error. The 
process is in this state when it has just been created (before an attach or 
launch) or when it's restarted. Neither should be treated as errors.

The current implementation can trigger this error (and a corresponding test 
failure) when we call WaitForProcessToStop after attaching  in asynchronous 
mode (for example when using ConnectRemote which is always asynchronous (due to 
a bug).

---
Full diff: https://github.com/llvm/llvm-project/pull/138601.diff


1 Files Affected:

- (modified) lldb/tools/lldb-dap/DAP.cpp (+1-3) 


``````````diff
diff --git a/lldb/tools/lldb-dap/DAP.cpp b/lldb/tools/lldb-dap/DAP.cpp
index 4cb0d8e49004c..4b631484c9fab 100644
--- a/lldb/tools/lldb-dap/DAP.cpp
+++ b/lldb/tools/lldb-dap/DAP.cpp
@@ -968,6 +968,7 @@ lldb::SBError 
DAP::WaitForProcessToStop(std::chrono::seconds seconds) {
   while (std::chrono::steady_clock::now() < timeout_time) {
     const auto state = process.GetState();
     switch (state) {
+    case lldb::eStateUnloaded:
     case lldb::eStateAttaching:
     case lldb::eStateConnected:
     case lldb::eStateInvalid:
@@ -982,9 +983,6 @@ lldb::SBError 
DAP::WaitForProcessToStop(std::chrono::seconds seconds) {
     case lldb::eStateExited:
       error.SetErrorString("process exited during launch or attach");
       return error;
-    case lldb::eStateUnloaded:
-      error.SetErrorString("process unloaded during launch or attach");
-      return error;
     case lldb::eStateCrashed:
     case lldb::eStateStopped:
       return lldb::SBError(); // Success!

``````````

</details>


https://github.com/llvm/llvm-project/pull/138601
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to