Skip to content

Commit 6891cb3

Browse files
committed
[LLDB] Turn off resilience bypass for textual swiftinterface files
As the old comment indicates, it was not expected that build systems would register binary swift modules produced from textual interfaces with -add_ast_path, but we have found examples of the in the wild and it leads to the most unexpected side effects. Fixing this is straightforward, we can just check if a binary module was compiled from a textual interface and then not bypass resilience. rdar://145226754
1 parent 767eadf commit 6891cb3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/Serialization/SerializedModuleLoader.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,10 +1788,11 @@ MemoryBufferSerializedModuleLoader::loadModule(SourceLoc importLoc,
17881788
Ctx.removeLoadedModule(moduleID.Item);
17891789
return nullptr;
17901790
}
1791-
// The MemoryBuffer loader is used by LLDB during debugging. Modules imported
1792-
// from .swift_ast sections are never produced from textual interfaces. By
1793-
// disabling resilience the debugger can directly access private members.
1794-
if (BypassResilience)
1791+
// The MemoryBuffer loader is used by LLDB during debugging. Modules
1792+
// imported from .swift_ast sections are not typically produced from
1793+
// textual interfaces. By disabling resilience, the debugger can
1794+
// directly access private members.
1795+
if (BypassResilience && !M->isBuiltFromInterface())
17951796
M->setBypassResilience();
17961797

17971798
return M;

0 commit comments

Comments
 (0)