[Lldb-commits] [lldb] r212863 - Allow generic ARM cores to match any more specific ARM architecture.

Greg Clayton gclayton at apple.com
Fri Jul 11 17:11:35 PDT 2014


Author: gclayton
Date: Fri Jul 11 19:11:34 2014
New Revision: 212863

URL: http://llvm.org/viewvc/llvm-project?rev=212863&view=rev
Log:
Allow generic ARM cores to match any more specific ARM architecture.

<rdar://problem/15932248>


Modified:
    lldb/trunk/source/Core/ArchSpec.cpp
    lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Modified: lldb/trunk/source/Core/ArchSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ArchSpec.cpp?rev=212863&r1=212862&r2=212863&view=diff
==============================================================================
--- lldb/trunk/source/Core/ArchSpec.cpp (original)
+++ lldb/trunk/source/Core/ArchSpec.cpp Fri Jul 11 19:11:34 2014
@@ -905,6 +905,10 @@ cores_match (const ArchSpec::Core core1,
     case ArchSpec::kCore_any:
         return true;
 
+    case ArchSpec::eCore_arm_generic:
+        if (enforce_exact_match)
+            break;
+        // Fall through to case below
     case ArchSpec::kCore_arm_any:
         if (core2 >= ArchSpec::kCore_arm_first && core2 <= ArchSpec::kCore_arm_last)
             return true;
@@ -932,6 +936,8 @@ cores_match (const ArchSpec::Core core1,
     case ArchSpec::eCore_arm_armv6m:
         if (!enforce_exact_match)
         {
+            if (core2 == ArchSpec::eCore_arm_generic)
+                return true;
             try_inverse = false;
             if (core2 == ArchSpec::eCore_arm_armv7)
                 return true;
@@ -949,9 +955,11 @@ cores_match (const ArchSpec::Core core1,
     case ArchSpec::eCore_arm_armv7s:
         if (!enforce_exact_match)
         {
-            try_inverse = false;
+            if (core2 == ArchSpec::eCore_arm_generic)
+                return true;
             if (core2 == ArchSpec::eCore_arm_armv7)
                 return true;
+            try_inverse = false;
         }
         break;
 

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=212863&r1=212862&r2=212863&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Fri Jul 11 19:11:34 2014
@@ -1251,8 +1251,29 @@ ObjectFileELF::GetSectionHeaderInfo(Sect
     if (arch_spec.GetTriple ().getOS () == llvm::Triple::OSType::UnknownOS)
     {
         arch_spec.SetArchitecture (eArchTypeELF, header.e_machine, LLDB_INVALID_CPUTYPE);
-        arch_spec.GetTriple().setOSName (Host::GetOSString().GetCString());
-        arch_spec.GetTriple().setVendorName(Host::GetVendorString().GetCString());
+        switch (arch_spec.GetAddressByteSize())
+        {
+        case 4:
+            {
+                const ArchSpec host_arch32 = Host::GetArchitecture (Host::eSystemDefaultArchitecture32);
+                if (host_arch32.GetCore() == arch_spec.GetCore())
+                {
+                    arch_spec.GetTriple().setOSName (Host::GetOSString().GetCString());
+                    arch_spec.GetTriple().setVendorName(Host::GetVendorString().GetCString());
+                }
+            }
+            break;
+        case 8:
+            {
+                const ArchSpec host_arch64 = Host::GetArchitecture (Host::eSystemDefaultArchitecture64);
+                if (host_arch64.GetCore() == arch_spec.GetCore())
+                {
+                    arch_spec.GetTriple().setOSName (Host::GetOSString().GetCString());
+                    arch_spec.GetTriple().setVendorName(Host::GetVendorString().GetCString());
+                }
+            }
+            break;
+        }
     }
 
     // If there are no section headers we are done.





More information about the lldb-commits mailing list