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:
@@ -257,6 +257,9 @@ private:
|
||||
|
||||
AccessNotesFile accessNotes;
|
||||
|
||||
/// Used by the debugger to bypass resilient access to fields.
|
||||
bool BypassResilience = false;
|
||||
|
||||
ModuleDecl(Identifier name, ASTContext &ctx, ImplicitImportInfo importInfo);
|
||||
|
||||
public:
|
||||
@@ -290,6 +293,12 @@ public:
|
||||
AccessNotesFile &getAccessNotes() { return accessNotes; }
|
||||
const AccessNotesFile &getAccessNotes() const { return accessNotes; }
|
||||
|
||||
/// Return whether the module was imported with resilience disabled. The
|
||||
/// debugger does this to access private fields.
|
||||
bool getBypassResilience() const { return BypassResilience; }
|
||||
/// Only to be called by MemoryBufferSerializedModuleLoader.
|
||||
void setBypassResilience() { BypassResilience = true; }
|
||||
|
||||
ArrayRef<FileUnit *> getFiles() {
|
||||
assert(!Files.empty() || failedToLoad());
|
||||
return Files;
|
||||
|
||||
Reference in New Issue
Block a user