summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp')
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp45
1 files changed, 34 insertions, 11 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index 1ca314d9815..5e2d8c31349 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -978,23 +978,46 @@ PlatformDarwin::GetQueueIDForThreadQAddress (Process *process, lldb::addr_t disp
bool
PlatformDarwin::x86GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch)
{
- if (idx == 0)
+ ArchSpec host_arch = Host::GetArchitecture (Host::eSystemDefaultArchitecture);
+ if (host_arch.GetCore() == ArchSpec::eCore_x86_64_x86_64h)
{
- arch = Host::GetArchitecture (Host::eSystemDefaultArchitecture);
- return arch.IsValid();
+ switch (idx)
+ {
+ case 0:
+ arch = host_arch;
+ return true;
+
+ case 1:
+ arch.SetTriple("x86_64-apple-macosx");
+ return true;
+
+ case 2:
+ arch = Host::GetArchitecture (Host::eSystemDefaultArchitecture32);
+ return true;
+
+ default: return false;
+ }
}
- else if (idx == 1)
+ else
{
- ArchSpec platform_arch (Host::GetArchitecture (Host::eSystemDefaultArchitecture));
- ArchSpec platform_arch64 (Host::GetArchitecture (Host::eSystemDefaultArchitecture64));
- if (platform_arch.IsExactMatch(platform_arch64))
+ if (idx == 0)
{
- // This macosx platform supports both 32 and 64 bit. Since we already
- // returned the 64 bit arch for idx == 0, return the 32 bit arch
- // for idx == 1
- arch = Host::GetArchitecture (Host::eSystemDefaultArchitecture32);
+ arch = Host::GetArchitecture (Host::eSystemDefaultArchitecture);
return arch.IsValid();
}
+ else if (idx == 1)
+ {
+ ArchSpec platform_arch (Host::GetArchitecture (Host::eSystemDefaultArchitecture));
+ ArchSpec platform_arch64 (Host::GetArchitecture (Host::eSystemDefaultArchitecture64));
+ if (platform_arch.IsExactMatch(platform_arch64))
+ {
+ // This macosx platform supports both 32 and 64 bit. Since we already
+ // returned the 64 bit arch for idx == 0, return the 32 bit arch
+ // for idx == 1
+ arch = Host::GetArchitecture (Host::eSystemDefaultArchitecture32);
+ return arch.IsValid();
+ }
+ }
}
return false;
}
OpenPOWER on IntegriCloud