[Lldb-commits] [lldb] r191587 - Add definitions for "armv6m", which indicates a Cortex-M0 processor.
Jason Molenda
jmolenda at apple.com
Fri Sep 27 16:21:55 PDT 2013
Author: jmolenda
Date: Fri Sep 27 18:21:54 2013
New Revision: 191587
URL: http://llvm.org/viewvc/llvm-project?rev=191587&view=rev
Log:
Add definitions for "armv6m", which indicates a Cortex-M0 processor.
It uses the T16 and a few T32 instructions from the ARMv7-A ISA.
<rdar://problem/15099306>
Modified:
lldb/trunk/include/lldb/Core/ArchSpec.h
lldb/trunk/source/Core/ArchSpec.cpp
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
Modified: lldb/trunk/include/lldb/Core/ArchSpec.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ArchSpec.h?rev=191587&r1=191586&r2=191587&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ArchSpec.h (original)
+++ lldb/trunk/include/lldb/Core/ArchSpec.h Fri Sep 27 18:21:54 2013
@@ -41,6 +41,7 @@ public:
eCore_arm_armv5e,
eCore_arm_armv5t,
eCore_arm_armv6,
+ eCore_arm_armv6m,
eCore_arm_armv7,
eCore_arm_armv7f,
eCore_arm_armv7s,
@@ -53,6 +54,7 @@ public:
eCore_thumbv5,
eCore_thumbv5e,
eCore_thumbv6,
+ eCore_thumbv6m,
eCore_thumbv7,
eCore_thumbv7f,
eCore_thumbv7s,
Modified: lldb/trunk/source/Core/ArchSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ArchSpec.cpp?rev=191587&r1=191586&r2=191587&view=diff
==============================================================================
--- lldb/trunk/source/Core/ArchSpec.cpp (original)
+++ lldb/trunk/source/Core/ArchSpec.cpp Fri Sep 27 18:21:54 2013
@@ -56,6 +56,7 @@ static const CoreDefinition g_core_defin
{ eByteOrderLittle, 4, 2, 4, llvm::Triple::arm , ArchSpec::eCore_arm_armv5e , "armv5e" },
{ eByteOrderLittle, 4, 2, 4, llvm::Triple::arm , ArchSpec::eCore_arm_armv5t , "armv5t" },
{ eByteOrderLittle, 4, 2, 4, llvm::Triple::arm , ArchSpec::eCore_arm_armv6 , "armv6" },
+ { eByteOrderLittle, 4, 2, 4, llvm::Triple::arm , ArchSpec::eCore_arm_armv6m , "armv6m" },
{ eByteOrderLittle, 4, 2, 4, llvm::Triple::arm , ArchSpec::eCore_arm_armv7 , "armv7" },
{ eByteOrderLittle, 4, 2, 4, llvm::Triple::arm , ArchSpec::eCore_arm_armv7f , "armv7f" },
{ eByteOrderLittle, 4, 2, 4, llvm::Triple::arm , ArchSpec::eCore_arm_armv7s , "armv7s" },
@@ -68,6 +69,7 @@ static const CoreDefinition g_core_defin
{ eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb , ArchSpec::eCore_thumbv5 , "thumbv5" },
{ eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb , ArchSpec::eCore_thumbv5e , "thumbv5e" },
{ eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb , ArchSpec::eCore_thumbv6 , "thumbv6" },
+ { eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb , ArchSpec::eCore_thumbv6m , "thumbv6m" },
{ eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb , ArchSpec::eCore_thumbv7 , "thumbv7" },
{ eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb , ArchSpec::eCore_thumbv7f , "thumbv7f" },
{ eByteOrderLittle, 4, 2, 4, llvm::Triple::thumb , ArchSpec::eCore_thumbv7s , "thumbv7s" },
@@ -883,6 +885,15 @@ cores_match (const ArchSpec::Core core1,
return true;
break;
+ case ArchSpec::eCore_arm_armv6m:
+ if (!enforce_exact_match)
+ {
+ try_inverse = false;
+ if (core2 == ArchSpec::eCore_arm_armv6)
+ return true;
+ }
+ break;
+
case ArchSpec::eCore_arm_armv7m:
case ArchSpec::eCore_arm_armv7em:
case ArchSpec::eCore_arm_armv7f:
Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=191587&r1=191586&r2=191587&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Fri Sep 27 18:21:54 2013
@@ -641,9 +641,15 @@ DisassemblerLLVMC::DisassemblerLLVMC (co
}
// Cortex-M3 devices (e.g. armv7m) can only execute thumb (T2) instructions,
- // so hardcode the primary disassembler to thumb mode.
+ // so hardcode the primary disassembler to thumb mode. Same for Cortex-M4 (armv7em).
+ //
+ // Handle the Cortex-M0 (armv6m) the same; the ISA is a subset of the T and T32
+ // instructions defined in ARMv7-A.
+
if (arch.GetTriple().getArch() == llvm::Triple::arm
- && (arch.GetCore() == ArchSpec::Core::eCore_arm_armv7m || arch.GetCore() == ArchSpec::Core::eCore_arm_armv7em))
+ && (arch.GetCore() == ArchSpec::Core::eCore_arm_armv7m
+ || arch.GetCore() == ArchSpec::Core::eCore_arm_armv7em
+ || arch.GetCore() == ArchSpec::Core::eCore_arm_armv6m))
{
triple = thumb_arch.GetTriple().getTriple().c_str();
}
Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=191587&r1=191586&r2=191587&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Fri Sep 27 18:21:54 2013
@@ -892,19 +892,21 @@ PlatformDarwin::ARMGetSupportedArchitect
case 4: arch.SetTriple ("armv7m-apple-ios"); return true;
case 5: arch.SetTriple ("armv7em-apple-ios"); return true;
case 6: arch.SetTriple ("armv6-apple-ios"); return true;
- case 7: arch.SetTriple ("armv5-apple-ios"); return true;
- case 8: arch.SetTriple ("armv4-apple-ios"); return true;
- case 9: arch.SetTriple ("arm-apple-ios"); return true;
- case 10: arch.SetTriple ("thumbv7-apple-ios"); return true;
- case 11: arch.SetTriple ("thumbv7f-apple-ios"); return true;
- case 12: arch.SetTriple ("thumbv7k-apple-ios"); return true;
- case 13: arch.SetTriple ("thumbv7s-apple-ios"); return true;
- case 14: arch.SetTriple ("thumbv7m-apple-ios"); return true;
- case 15: arch.SetTriple ("thumbv7em-apple-ios"); return true;
- case 16: arch.SetTriple ("thumbv6-apple-ios"); return true;
- case 17: arch.SetTriple ("thumbv5-apple-ios"); return true;
- case 18: arch.SetTriple ("thumbv4t-apple-ios"); return true;
- case 19: arch.SetTriple ("thumb-apple-ios"); return true;
+ case 7: arch.SetTriple ("armv6m-apple-ios"); return true;
+ case 8: arch.SetTriple ("armv5-apple-ios"); return true;
+ case 9: arch.SetTriple ("armv4-apple-ios"); return true;
+ case 10: arch.SetTriple ("arm-apple-ios"); return true;
+ case 11: arch.SetTriple ("thumbv7-apple-ios"); return true;
+ case 12: arch.SetTriple ("thumbv7f-apple-ios"); return true;
+ case 13: arch.SetTriple ("thumbv7k-apple-ios"); return true;
+ case 14: arch.SetTriple ("thumbv7s-apple-ios"); return true;
+ case 15: arch.SetTriple ("thumbv7m-apple-ios"); return true;
+ case 16: arch.SetTriple ("thumbv7em-apple-ios"); return true;
+ case 17: arch.SetTriple ("thumbv6-apple-ios"); return true;
+ case 18: arch.SetTriple ("thumbv6m-apple-ios"); return true;
+ case 19: arch.SetTriple ("thumbv5-apple-ios"); return true;
+ case 20: arch.SetTriple ("thumbv4t-apple-ios"); return true;
+ case 21: arch.SetTriple ("thumb-apple-ios"); return true;
default: break;
}
break;
@@ -914,16 +916,18 @@ PlatformDarwin::ARMGetSupportedArchitect
{
case 0: arch.SetTriple ("armv7f-apple-ios"); return true;
case 1: arch.SetTriple ("armv7-apple-ios"); return true;
- case 2: arch.SetTriple ("armv6-apple-ios"); return true;
- case 3: arch.SetTriple ("armv5-apple-ios"); return true;
- case 4: arch.SetTriple ("armv4-apple-ios"); return true;
- case 5: arch.SetTriple ("arm-apple-ios"); return true;
- case 6: arch.SetTriple ("thumbv7f-apple-ios"); return true;
- case 7: arch.SetTriple ("thumbv7-apple-ios"); return true;
- case 8: arch.SetTriple ("thumbv6-apple-ios"); return true;
- case 9: arch.SetTriple ("thumbv5-apple-ios"); return true;
- case 10: arch.SetTriple ("thumbv4t-apple-ios"); return true;
- case 11: arch.SetTriple ("thumb-apple-ios"); return true;
+ case 2: arch.SetTriple ("armv6m-apple-ios"); return true;
+ case 3: arch.SetTriple ("armv6-apple-ios"); return true;
+ case 4: arch.SetTriple ("armv5-apple-ios"); return true;
+ case 5: arch.SetTriple ("armv4-apple-ios"); return true;
+ case 6: arch.SetTriple ("arm-apple-ios"); return true;
+ case 7: arch.SetTriple ("thumbv7f-apple-ios"); return true;
+ case 8: arch.SetTriple ("thumbv7-apple-ios"); return true;
+ case 9: arch.SetTriple ("thumbv6m-apple-ios"); return true;
+ case 10: arch.SetTriple ("thumbv6-apple-ios"); return true;
+ case 11: arch.SetTriple ("thumbv5-apple-ios"); return true;
+ case 12: arch.SetTriple ("thumbv4t-apple-ios"); return true;
+ case 13: arch.SetTriple ("thumb-apple-ios"); return true;
default: break;
}
break;
@@ -933,16 +937,18 @@ PlatformDarwin::ARMGetSupportedArchitect
{
case 0: arch.SetTriple ("armv7k-apple-ios"); return true;
case 1: arch.SetTriple ("armv7-apple-ios"); return true;
- case 2: arch.SetTriple ("armv6-apple-ios"); return true;
- case 3: arch.SetTriple ("armv5-apple-ios"); return true;
- case 4: arch.SetTriple ("armv4-apple-ios"); return true;
- case 5: arch.SetTriple ("arm-apple-ios"); return true;
- case 6: arch.SetTriple ("thumbv7k-apple-ios"); return true;
- case 7: arch.SetTriple ("thumbv7-apple-ios"); return true;
- case 8: arch.SetTriple ("thumbv6-apple-ios"); return true;
- case 9: arch.SetTriple ("thumbv5-apple-ios"); return true;
- case 10: arch.SetTriple ("thumbv4t-apple-ios"); return true;
- case 11: arch.SetTriple ("thumb-apple-ios"); return true;
+ case 2: arch.SetTriple ("armv6m-apple-ios"); return true;
+ case 3: arch.SetTriple ("armv6-apple-ios"); return true;
+ case 4: arch.SetTriple ("armv5-apple-ios"); return true;
+ case 5: arch.SetTriple ("armv4-apple-ios"); return true;
+ case 6: arch.SetTriple ("arm-apple-ios"); return true;
+ case 7: arch.SetTriple ("thumbv7k-apple-ios"); return true;
+ case 8: arch.SetTriple ("thumbv7-apple-ios"); return true;
+ case 9: arch.SetTriple ("thumbv6m-apple-ios"); return true;
+ case 10: arch.SetTriple ("thumbv6-apple-ios"); return true;
+ case 11: arch.SetTriple ("thumbv5-apple-ios"); return true;
+ case 12: arch.SetTriple ("thumbv4t-apple-ios"); return true;
+ case 13: arch.SetTriple ("thumb-apple-ios"); return true;
default: break;
}
break;
@@ -952,16 +958,18 @@ PlatformDarwin::ARMGetSupportedArchitect
{
case 0: arch.SetTriple ("armv7s-apple-ios"); return true;
case 1: arch.SetTriple ("armv7-apple-ios"); return true;
- case 2: arch.SetTriple ("armv6-apple-ios"); return true;
- case 3: arch.SetTriple ("armv5-apple-ios"); return true;
- case 4: arch.SetTriple ("armv4-apple-ios"); return true;
- case 5: arch.SetTriple ("arm-apple-ios"); return true;
- case 6: arch.SetTriple ("thumbv7s-apple-ios"); return true;
- case 7: arch.SetTriple ("thumbv7-apple-ios"); return true;
- case 8: arch.SetTriple ("thumbv6-apple-ios"); return true;
- case 9: arch.SetTriple ("thumbv5-apple-ios"); return true;
- case 10: arch.SetTriple ("thumbv4t-apple-ios"); return true;
- case 11: arch.SetTriple ("thumb-apple-ios"); return true;
+ case 2: arch.SetTriple ("armv6m-apple-ios"); return true;
+ case 3: arch.SetTriple ("armv6-apple-ios"); return true;
+ case 4: arch.SetTriple ("armv5-apple-ios"); return true;
+ case 5: arch.SetTriple ("armv4-apple-ios"); return true;
+ case 6: arch.SetTriple ("arm-apple-ios"); return true;
+ case 7: arch.SetTriple ("thumbv7s-apple-ios"); return true;
+ case 8: arch.SetTriple ("thumbv7-apple-ios"); return true;
+ case 9: arch.SetTriple ("thumbv6m-apple-ios"); return true;
+ case 10: arch.SetTriple ("thumbv6-apple-ios"); return true;
+ case 11: arch.SetTriple ("thumbv5-apple-ios"); return true;
+ case 12: arch.SetTriple ("thumbv4t-apple-ios"); return true;
+ case 13: arch.SetTriple ("thumb-apple-ios"); return true;
default: break;
}
break;
@@ -971,16 +979,18 @@ PlatformDarwin::ARMGetSupportedArchitect
{
case 0: arch.SetTriple ("armv7m-apple-ios"); return true;
case 1: arch.SetTriple ("armv7-apple-ios"); return true;
- case 2: arch.SetTriple ("armv6-apple-ios"); return true;
- case 3: arch.SetTriple ("armv5-apple-ios"); return true;
- case 4: arch.SetTriple ("armv4-apple-ios"); return true;
- case 5: arch.SetTriple ("arm-apple-ios"); return true;
- case 6: arch.SetTriple ("thumbv7m-apple-ios"); return true;
- case 7: arch.SetTriple ("thumbv7-apple-ios"); return true;
- case 8: arch.SetTriple ("thumbv6-apple-ios"); return true;
- case 9: arch.SetTriple ("thumbv5-apple-ios"); return true;
- case 10: arch.SetTriple ("thumbv4t-apple-ios"); return true;
- case 11: arch.SetTriple ("thumb-apple-ios"); return true;
+ case 2: arch.SetTriple ("armv6m-apple-ios"); return true;
+ case 3: arch.SetTriple ("armv6-apple-ios"); return true;
+ case 4: arch.SetTriple ("armv5-apple-ios"); return true;
+ case 5: arch.SetTriple ("armv4-apple-ios"); return true;
+ case 6: arch.SetTriple ("arm-apple-ios"); return true;
+ case 7: arch.SetTriple ("thumbv7m-apple-ios"); return true;
+ case 8: arch.SetTriple ("thumbv7-apple-ios"); return true;
+ case 9: arch.SetTriple ("thumbv6m-apple-ios"); return true;
+ case 10: arch.SetTriple ("thumbv6-apple-ios"); return true;
+ case 11: arch.SetTriple ("thumbv5-apple-ios"); return true;
+ case 12: arch.SetTriple ("thumbv4t-apple-ios"); return true;
+ case 13: arch.SetTriple ("thumb-apple-ios"); return true;
default: break;
}
break;
@@ -988,14 +998,35 @@ PlatformDarwin::ARMGetSupportedArchitect
case ArchSpec::eCore_arm_armv7em:
switch (idx)
{
- case 0: arch.SetTriple ("armv7em-apple-ios"); return true;
+ case 0: arch.SetTriple ("armv7em-apple-ios"); return true;
case 1: arch.SetTriple ("armv7-apple-ios"); return true;
+ case 2: arch.SetTriple ("armv6m-apple-ios"); return true;
+ case 3: arch.SetTriple ("armv6-apple-ios"); return true;
+ case 4: arch.SetTriple ("armv5-apple-ios"); return true;
+ case 5: arch.SetTriple ("armv4-apple-ios"); return true;
+ case 6: arch.SetTriple ("arm-apple-ios"); return true;
+ case 7: arch.SetTriple ("thumbv7em-apple-ios"); return true;
+ case 8: arch.SetTriple ("thumbv7-apple-ios"); return true;
+ case 9: arch.SetTriple ("thumbv6m-apple-ios"); return true;
+ case 10: arch.SetTriple ("thumbv6-apple-ios"); return true;
+ case 11: arch.SetTriple ("thumbv5-apple-ios"); return true;
+ case 12: arch.SetTriple ("thumbv4t-apple-ios"); return true;
+ case 13: arch.SetTriple ("thumb-apple-ios"); return true;
+ default: break;
+ }
+ break;
+
+ case ArchSpec::eCore_arm_armv7:
+ switch (idx)
+ {
+ case 0: arch.SetTriple ("armv7-apple-ios"); return true;
+ case 1: arch.SetTriple ("armv6m-apple-ios"); return true;
case 2: arch.SetTriple ("armv6-apple-ios"); return true;
case 3: arch.SetTriple ("armv5-apple-ios"); return true;
case 4: arch.SetTriple ("armv4-apple-ios"); return true;
case 5: arch.SetTriple ("arm-apple-ios"); return true;
- case 6: arch.SetTriple ("thumbv7em-apple-ios"); return true;
- case 7: arch.SetTriple ("thumbv7-apple-ios"); return true;
+ case 6: arch.SetTriple ("thumbv7-apple-ios"); return true;
+ case 7: arch.SetTriple ("thumbv6m-apple-ios"); return true;
case 8: arch.SetTriple ("thumbv6-apple-ios"); return true;
case 9: arch.SetTriple ("thumbv5-apple-ios"); return true;
case 10: arch.SetTriple ("thumbv4t-apple-ios"); return true;
@@ -1004,15 +1035,15 @@ PlatformDarwin::ARMGetSupportedArchitect
}
break;
- case ArchSpec::eCore_arm_armv7:
+ case ArchSpec::eCore_arm_armv6m:
switch (idx)
{
- case 0: arch.SetTriple ("armv7-apple-ios"); return true;
+ case 0: arch.SetTriple ("armv6m-apple-ios"); return true;
case 1: arch.SetTriple ("armv6-apple-ios"); return true;
case 2: arch.SetTriple ("armv5-apple-ios"); return true;
case 3: arch.SetTriple ("armv4-apple-ios"); return true;
case 4: arch.SetTriple ("arm-apple-ios"); return true;
- case 5: arch.SetTriple ("thumbv7-apple-ios"); return true;
+ case 5: arch.SetTriple ("thumbv6m-apple-ios"); return true;
case 6: arch.SetTriple ("thumbv6-apple-ios"); return true;
case 7: arch.SetTriple ("thumbv5-apple-ios"); return true;
case 8: arch.SetTriple ("thumbv4t-apple-ios"); return true;
More information about the lldb-commits
mailing list