[Lldb-commits] [lldb] [lldb-dap] Adding support for cancelling a request. (PR #130169)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 31 10:30:56 PDT 2025


================
@@ -671,11 +693,25 @@ void DAP::SetTarget(const lldb::SBTarget target) {
   }
 }
 
-bool DAP::HandleObject(const protocol::Message &M) {
-  if (const auto *req = std::get_if<protocol::Request>(&M)) {
+bool DAP::HandleObject(const Message &M) {
+  if (const auto *req = std::get_if<Request>(&M)) {
+    {
+      std::lock_guard<std::mutex> lock(m_active_request_mutex);
+      m_active_request = req;
+
+      // Clear interrupt marker prior to handling the next request.
+      if (debugger.InterruptRequested())
+        debugger.CancelInterruptRequest();
----------------
JDevlieghere wrote:

I think we should clear the interrupt flag as soon as possible. Why not do this in DAP send and checkhere that the flag is taken down before we start the next request. 

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


More information about the lldb-commits mailing list