Skip to content

Commit af09a65

Browse files
authored
Merge pull request swiftlang#10726 from swiftlang/lldb-dap-modules-event-backport-2
[lldb-dap] Avoid double 'new' events for dyld on Darwin (llvm#140810)
2 parents 8178474 + 1994014 commit af09a65

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

lldb/tools/lldb-dap/lldb-dap.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -540,22 +540,17 @@ void EventThreadFunction(DAP &dap) {
540540

541541
llvm::StringRef reason;
542542
bool id_only = false;
543-
if (event_mask & lldb::SBTarget::eBroadcastBitModulesLoaded) {
544-
dap.modules.insert(module_id);
545-
reason = "new";
546-
} else {
547-
// If this is a module we've never told the client about, don't
548-
// send an event.
549-
if (!dap.modules.contains(module_id))
550-
continue;
551-
543+
if (dap.modules.contains(module_id)) {
552544
if (event_mask & lldb::SBTarget::eBroadcastBitModulesUnloaded) {
553545
dap.modules.erase(module_id);
554546
reason = "removed";
555547
id_only = true;
556548
} else {
557549
reason = "changed";
558550
}
551+
} else {
552+
dap.modules.insert(module_id);
553+
reason = "new";
559554
}
560555

561556
llvm::json::Object body;

0 commit comments

Comments
 (0)