diff options
author | Jason Molenda <jmolenda@apple.com> | 2011-12-09 07:50:50 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2011-12-09 07:50:50 +0000 |
commit | d74db47a41ae4f92f0d22a5a930d87d3fade91f8 (patch) | |
tree | 78faa4cf053efc2cea8dd51a2ed3d76ebbe65e65 /lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp | |
parent | 941aae0e9d5f360f8aa7d3382578e23ebfff8df7 (diff) | |
download | bcm5719-llvm-d74db47a41ae4f92f0d22a5a930d87d3fade91f8.tar.gz bcm5719-llvm-d74db47a41ae4f92f0d22a5a930d87d3fade91f8.zip |
Move the ARM specific arch picker from PlatformRemoteiOS.cpp to
PlatformDarwin.cpp -- call it from both PlatformRemoteiOS.cpp
and the native process PlatformDarwin.cpp when running on an arm
system.
Bump lldb version number to 94.
llvm-svn: 146249
Diffstat (limited to 'lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp')
-rw-r--r-- | lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp index 7e2d3cdffe2..8e139690964 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -501,3 +501,114 @@ PlatformDarwin::ModuleIsExcludedForNonModuleSpecificSearches (lldb_private::Targ else return false; } + + +// The architecture selection rules for arm processors +// These cpu subtypes have distinct names (e.g. armv7f) but armv7 binaries run fine on an armv7f processor. + +bool +PlatformDarwin::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch) +{ + ArchSpec system_arch (GetSystemArchitecture()); + const ArchSpec::Core system_core = system_arch.GetCore(); + switch (system_core) + { + default: + switch (idx) + { + case 0: arch.SetTriple ("armv7-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv7f-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv7k-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("armv7s-apple-darwin", NULL); return true; + case 4: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 5: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 6: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 7: arch.SetTriple ("arm-apple-darwin", NULL); return true; + default: break; + } + break; + + case ArchSpec::eCore_arm_armv7f: + switch (idx) + { + case 0: arch.SetTriple ("armv7f-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv7-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 4: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 5: arch.SetTriple ("arm-apple-darwin", NULL); return true; + default: break; + } + break; + + case ArchSpec::eCore_arm_armv7k: + switch (idx) + { + case 0: arch.SetTriple ("armv7k-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv7-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 4: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 5: arch.SetTriple ("arm-apple-darwin", NULL); return true; + default: break; + } + break; + + case ArchSpec::eCore_arm_armv7s: + switch (idx) + { + case 0: arch.SetTriple ("armv7s-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv7-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 4: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 5: arch.SetTriple ("arm-apple-darwin", NULL); return true; + default: break; + } + break; + + case ArchSpec::eCore_arm_armv7: + switch (idx) + { + case 0: arch.SetTriple ("armv7-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 4: arch.SetTriple ("arm-apple-darwin", NULL); return true; + default: break; + } + break; + + case ArchSpec::eCore_arm_armv6: + switch (idx) + { + case 0: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("arm-apple-darwin", NULL); return true; + default: break; + } + break; + + case ArchSpec::eCore_arm_armv5: + switch (idx) + { + case 0: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("arm-apple-darwin", NULL); return true; + default: break; + } + break; + + case ArchSpec::eCore_arm_armv4: + switch (idx) + { + case 0: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("arm-apple-darwin", NULL); return true; + default: break; + } + break; + } + arch.Clear(); + return false; +} |