diff options
| -rw-r--r-- | lldb/source/Core/ArchSpec.cpp | 9 | ||||
| -rw-r--r-- | lldb/source/Host/common/Host.cpp | 24 |
2 files changed, 24 insertions, 9 deletions
diff --git a/lldb/source/Core/ArchSpec.cpp b/lldb/source/Core/ArchSpec.cpp index bfe8b62f5eb..ea7f3a46d6c 100644 --- a/lldb/source/Core/ArchSpec.cpp +++ b/lldb/source/Core/ArchSpec.cpp @@ -962,6 +962,15 @@ cores_match (const ArchSpec::Core core1, const ArchSpec::Core core2, bool try_in try_inverse = false; } break; + + case ArchSpec::eCore_x86_64_x86_64h: + if (!enforce_exact_match) + { + try_inverse = false; + if (core2 == ArchSpec::eCore_x86_64_x86_64) + return true; + } + break; default: break; diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp index fa3d3bc1aef..5c8d382c15c 100644 --- a/lldb/source/Host/common/Host.cpp +++ b/lldb/source/Host/common/Host.cpp @@ -344,26 +344,32 @@ Host::GetArchitecture (SystemDefaultArchitecture arch_kind) if (is_64_bit_capable) { -#if defined (__i386__) || defined (__x86_64__) - if (cpusubtype == CPU_SUBTYPE_486) - cpusubtype = CPU_SUBTYPE_I386_ALL; -#endif if (cputype & CPU_ARCH_ABI64) { // We have a 64 bit kernel on a 64 bit system - g_host_arch_32.SetArchitecture (eArchTypeMachO, ~(CPU_ARCH_MASK) & cputype, cpusubtype); g_host_arch_64.SetArchitecture (eArchTypeMachO, cputype, cpusubtype); } else { - // We have a 32 bit kernel on a 64 bit system - g_host_arch_32.SetArchitecture (eArchTypeMachO, cputype, cpusubtype); - cputype |= CPU_ARCH_ABI64; - g_host_arch_64.SetArchitecture (eArchTypeMachO, cputype, cpusubtype); + // We have a 64 bit kernel that is returning a 32 bit cputype, the + // cpusubtype will be correct as if it were for a 64 bit architecture + g_host_arch_64.SetArchitecture (eArchTypeMachO, cputype | CPU_ARCH_ABI64, cpusubtype); } + + // Now we need modify the cpusubtype for the 32 bit slices. + uint32_t cpusubtype32 = cpusubtype; +#if defined (__i386__) || defined (__x86_64__) + if (cpusubtype == CPU_SUBTYPE_486 || cpusubtype == CPU_SUBTYPE_X86_64_H) + cpusubtype32 = CPU_SUBTYPE_I386_ALL; +#elif defined (__arm__) || defined (__arm64__) || defined (__aarch64__) + if (cputype == CPU_TYPE_ARM || cputype == CPU_TYPE_ARM64) + cpusubtype32 = CPU_SUBTYPE_ARM_V7S; +#endif + g_host_arch_32.SetArchitecture (eArchTypeMachO, cputype & ~(CPU_ARCH_MASK), cpusubtype32); } else { + // We have a 32 bit kernel on a 32 bit system g_host_arch_32.SetArchitecture (eArchTypeMachO, cputype, cpusubtype); g_host_arch_64.Clear(); } |

