================ @@ -893,10 +893,23 @@ llvm::Error DAP::Loop() { return errWrapper; } + // The launch sequence is special and we need to carefully handle + // packets in the right order. The launch and attach requests cannot + // be answered until we've gotten the confgigurationDone request. We + // can't answer the threads request until we've successfully launched + // or attached. + bool is_part_of_launch_sequence = false; + if (const protocol::Request *req = - std::get_if<protocol::Request>(&*next); - req && req->command == "disconnect") { - disconnecting = true; + std::get_if<protocol::Request>(&*next)) { + if (req->command == "disconnect") + disconnecting = true; ---------------- JDevlieghere wrote:
Ack, I noticed the same thing when running the tests and all of them would fail because we didn't respond to the disconnecting request. I think what you're suggesting makes sense: if we stop reading new messages after we've seen disconnecting, we can use the queue being empty as a way to signal that we're done. https://github.com/llvm/llvm-project/pull/138219 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits