[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
This commit is contained in:
Adrian Prantl
2025-03-25 12:17:27 -07:00
parent 767eadfb77
commit 6891cb37a2

View File

@@ -1788,10 +1788,11 @@ MemoryBufferSerializedModuleLoader::loadModule(SourceLoc importLoc,
Ctx.removeLoadedModule(moduleID.Item);
return nullptr;
}
// The MemoryBuffer loader is used by LLDB during debugging. Modules imported
// from .swift_ast sections are never produced from textual interfaces. By
// disabling resilience the debugger can directly access private members.
if (BypassResilience)
// The MemoryBuffer loader is used by LLDB during debugging. Modules
// imported from .swift_ast sections are not typically produced from
// textual interfaces. By disabling resilience, the debugger can
// directly access private members.
if (BypassResilience && !M->isBuiltFromInterface())
M->setBypassResilience();
return M;