summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp111
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h2
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp5
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp103
4 files changed, 118 insertions, 103 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;
+}
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
index 5ed533da3a3..0052a8efde4 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
@@ -88,6 +88,8 @@ public:
virtual bool
ModuleIsExcludedForNonModuleSpecificSearches (lldb_private::Target &target, const lldb::ModuleSP &module_sp);
+ bool ARMGetSupportedArchitectureAtIndex (uint32_t idx, lldb_private::ArchSpec &arch);
+
protected:
lldb::PlatformSP m_remote_platform_sp; // Allow multiple ways to connect to a remote darwin OS
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
index 02d662bc2bc..3a0e036f055 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
@@ -178,6 +178,10 @@ PlatformMacOSX::GetSharedModule (const FileSpec &platform_file,
bool
PlatformMacOSX::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch)
{
+#if defined (__arm__)
+ return ARMGetSupportedArchitectureAtIndex (idx, arch);
+#endif
+
if (idx == 0)
{
arch = Host::GetArchitecture (Host::eSystemDefaultArchitecture);
@@ -199,4 +203,3 @@ PlatformMacOSX::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch)
return false;
}
-
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
index 2b83156e759..62d85451249 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
@@ -485,106 +485,5 @@ PlatformRemoteiOS::GetProcessInfo (lldb::pid_t pid, ProcessInstanceInfo &process
bool
PlatformRemoteiOS::GetSupportedArchitectureAtIndex (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;
+ return ARMGetSupportedArchitectureAtIndex (idx, arch);
}
OpenPOWER on IntegriCloud