diff --git a/lldb/tools/lldb-dap/DAP.cpp b/lldb/tools/lldb-dap/DAP.cpp index 3419b2c3a841b..f6241b7d98456 100644 --- a/lldb/tools/lldb-dap/DAP.cpp +++ b/lldb/tools/lldb-dap/DAP.cpp @@ -1292,15 +1292,7 @@ void DAP::EventThread() { llvm::StringRef reason; bool id_only = false; - if (event_mask & lldb::SBTarget::eBroadcastBitModulesLoaded) { - modules.insert(module_id); - reason = "new"; - } else { - // If this is a module we've never told the client about, don't - // send an event. - if (!modules.contains(module_id)) - continue; - + if (modules.contains(module_id)) { if (event_mask & lldb::SBTarget::eBroadcastBitModulesUnloaded) { modules.erase(module_id); reason = "removed"; @@ -1308,6 +1300,9 @@ void DAP::EventThread() { } else { reason = "changed"; } + } else { + modules.insert(module_id); + reason = "new"; } llvm::json::Object body;