Change Target::ReadMemoryFromFileCache to not read from the file
if the section is marked as encrypted. It will likely be readable
in live memory.
<rdar://problem/11305675>
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@155509 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/Target.cpp b/source/Target/Target.cpp
index 6671a76..ef187da 100644
--- a/source/Target/Target.cpp
+++ b/source/Target/Target.cpp
@@ -1064,6 +1064,11 @@
SectionSP section_sp (addr.GetSection());
if (section_sp)
{
+ // If the contents of this section are encrypted, the on-disk file is unusuable. Read only from live memory.
+ if (section_sp->IsEncrypted())
+ {
+ return 0;
+ }
ModuleSP module_sp (section_sp->GetModule());
if (module_sp)
{