[Lldb-commits] [lldb] r168205 - /lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Greg Clayton gclayton at apple.com
Fri Nov 16 13:36:11 PST 2012


Author: gclayton
Date: Fri Nov 16 15:36:10 2012
New Revision: 168205

URL: http://llvm.org/viewvc/llvm-project?rev=168205&view=rev
Log:
<rdar://problem/12238339> 

Make sure architectures are obeyed for skinny mach files.


Modified:
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=168205&r1=168204&r2=168205&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Fri Nov 16 15:36:10 2012
@@ -562,6 +562,11 @@
 
             ArchSpec mach_arch(eArchTypeMachO, m_header.cputype, m_header.cpusubtype);
             
+            // Check if the module has a required architecture
+            const ArchSpec &module_arch = module_sp->GetArchitecture();
+            if (module_arch.IsValid() && !module_arch.IsExactMatch(mach_arch))
+                return false;
+
             if (SetModulesArchitecture (mach_arch))
             {
                 const size_t header_and_lc_size = m_header.sizeofcmds + MachHeaderSizeFromMagic(m_header.magic);





More information about the lldb-commits mailing list