Skip to content

Commit 1c1238d

Browse files
authored
[lldb-dap] Don't error out when the process is in eStateUnloaded (#138601)
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).
1 parent 8b9ae65 commit 1c1238d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lldb/tools/lldb-dap/DAP.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,7 @@ lldb::SBError DAP::WaitForProcessToStop(std::chrono::seconds seconds) {
968968
while (std::chrono::steady_clock::now() < timeout_time) {
969969
const auto state = process.GetState();
970970
switch (state) {
971+
case lldb::eStateUnloaded:
971972
case lldb::eStateAttaching:
972973
case lldb::eStateConnected:
973974
case lldb::eStateInvalid:
@@ -982,9 +983,6 @@ lldb::SBError DAP::WaitForProcessToStop(std::chrono::seconds seconds) {
982983
case lldb::eStateExited:
983984
error.SetErrorString("process exited during launch or attach");
984985
return error;
985-
case lldb::eStateUnloaded:
986-
error.SetErrorString("process unloaded during launch or attach");
987-
return error;
988986
case lldb::eStateCrashed:
989987
case lldb::eStateStopped:
990988
return lldb::SBError(); // Success!

0 commit comments

Comments
 (0)