mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Disable resilience for modules imported by the MemoryBuffer loader.
The MemoryBuffer loader is used by LLDB during debugging to import binary Swift modules from .swift_ast sections. Modules imported from .swift_ast sections are never produced from textual interfaces. By disabling resilience the expression evaluator in the debugger can directly access private members. rdar://79462915
This commit is contained in:
@@ -1205,6 +1205,11 @@ MemoryBufferSerializedModuleLoader::loadModule(SourceLoc importLoc,
|
||||
if (!file)
|
||||
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)
|
||||
M->setBypassResilience();
|
||||
M->addFile(*file);
|
||||
Ctx.addLoadedModule(M);
|
||||
return M;
|
||||
|
||||
Reference in New Issue
Block a user