Author: gclayton
Date: Thu Jun  9 12:52:02 2016
New Revision: 272281

URL: http://llvm.org/viewvc/llvm-project?rev=272281&view=rev
Log:
Some core files on MacOSX don't have permissions setup correctly on the 
LC_SEGMENT load commands. Assume read + execute if the permissions are not set.

<rdar://problem/26720522> 


Modified:
    lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp

Modified: lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp?rev=272281&r1=272280&r2=272281&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp Thu Jun  9 
12:52:02 2016
@@ -306,8 +306,15 @@ ProcessMachCore::DoLoadCore ()
             {
                 m_core_aranges.Append(range_entry);
             }
+            // Some core files don't fill in the permissions correctly. If 
that is the case
+            // assume read + execute so clients don't think the memory is not 
readable,
+            // or executable. The memory isn't writable since this plug-in 
doesn't implement
+            // DoWriteMemory.
+            uint32_t permissions = section->GetPermissions();
+            if (permissions == 0)
+                permissions = lldb::ePermissionsReadable | 
lldb::ePermissionsExecutable;
             m_core_range_infos.Append(
-                VMRangeToPermissions::Entry(section_vm_addr, 
section->GetByteSize(), section->GetPermissions()));
+                VMRangeToPermissions::Entry(section_vm_addr, 
section->GetByteSize(), permissions));
         }
     }
     if (!ranges_are_sorted)


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to