diff options
| -rw-r--r-- | lldb/include/lldb/Core/ArchSpec.h | 2 | ||||
| -rw-r--r-- | lldb/source/Core/ArchSpec.cpp | 11 | ||||
| -rw-r--r-- | lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp | 10 | ||||
| -rw-r--r-- | lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp | 149 |
4 files changed, 111 insertions, 61 deletions
diff --git a/lldb/include/lldb/Core/ArchSpec.h b/lldb/include/lldb/Core/ArchSpec.h index 3bfa96be0ce..5957ffd3d5d 100644 --- a/lldb/include/lldb/Core/ArchSpec.h +++ b/lldb/include/lldb/Core/ArchSpec.h @@ -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, diff --git a/lldb/source/Core/ArchSpec.cpp b/lldb/source/Core/ArchSpec.cpp index 836a0efa890..e19341bc6a9 100644 --- a/lldb/source/Core/ArchSpec.cpp +++ b/lldb/source/Core/ArchSpec.cpp @@ -56,6 +56,7 @@ static const CoreDefinition g_core_definitions[ArchSpec::kNumCores] = { 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_definitions[ArchSpec::kNumCores] = { 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, const ArchSpec::Core core2, bool try_in 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: diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp index 099b72a73f8..61c3c64d4fc 100644 --- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp +++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp @@ -641,9 +641,15 @@ DisassemblerLLVMC::DisassemblerLLVMC (const ArchSpec &arch, const char *flavor_s } // 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(); } diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp index cc2093b137f..2f53c2ad26a 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -892,19 +892,21 @@ PlatformDarwin::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch 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::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch { 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::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch { 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::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch { 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::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch { 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::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch 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::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch } 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; |

