Index: lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp +++ lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp @@ -137,8 +137,6 @@ PlatformMacOSX::GetSupportedArchitectures(const ArchSpec &host_arch) { std::vector result; #if defined(__arm__) || defined(__arm64__) || defined(__aarch64__) - // macOS for ARM64 support both native and translated x86_64 processes - // When cmdline lldb is run on iOS, watchOS, etc, it is still // using "PlatformMacOSX". llvm::Triple::OSType host_os = GetHostOSType(); @@ -152,6 +150,21 @@ result.push_back(ArchSpec("x86_64-apple-ios-macabi")); result.push_back(ArchSpec("arm64-apple-ios-macabi")); result.push_back(ArchSpec("arm64e-apple-ios-macabi")); + + // On Apple Silicon, the host platform is compatible with iOS triples to + // support unmodified "iPhone and iPad Apps on Apple Silicon Macs". Because + // the binaries are identical, we must rely on the host architecture to + // tell them apart and mark the host platform as compatible or not. + if (host_arch.IsValid()) { + llvm::Triple host_triple = host_arch.GetTriple(); + if (host_triple.getOS() == llvm::Triple::MacOSX) { + result.push_back(ArchSpec("arm64-apple-ios")); + result.push_back(ArchSpec("arm64e-apple-ios")); + } + } else { + result.push_back(ArchSpec("arm64-apple-ios")); + result.push_back(ArchSpec("arm64e-apple-ios")); + } } #else x86GetSupportedArchitectures(result);