summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ArchSpec.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2014-05-29 21:33:45 +0000
committerGreg Clayton <gclayton@apple.com>2014-05-29 21:33:45 +0000
commit7ab7f89ae0221b11d25b5554b0b38ff4a8188819 (patch)
tree95b143f03fce4304751874cebfe859d7f2bf67e9 /lldb/source/Core/ArchSpec.cpp
parentc1146ec5badb4eb1b14d423d4305e698144dc5a4 (diff)
downloadbcm5719-llvm-7ab7f89ae0221b11d25b5554b0b38ff4a8188819.tar.gz
bcm5719-llvm-7ab7f89ae0221b11d25b5554b0b38ff4a8188819.zip
iOS simulator cleanup to make sure we use "*-apple-ios" for iOS simulator apps and binaries.
Changes include: - ObjectFileMachO can now determine if a binary is "*-apple-ios" or "*-apple-macosx" by checking the min OS and SDK load commands - ArchSpec now says "<arch>-apple-macosx" is equivalent to "<arch>-apple-ios" since the simulator mixes and matches binaries (some from the system and most from the iOS SDK). - Getting process inforamtion on MacOSX now correctly classifies iOS simulator processes so they have "*-apple-ios" architectures in the ProcessInstanceInfo - PlatformiOSSimulator can now list iOS simulator processes correctly instead of showing nothing by using: (lldb) platform select ios-simulator (lldb) platform process list - debugserver can now properly return "*-apple-ios" for the triple in the process info packets for iOS simulator executables - GDBRemoteCommunicationClient now correctly passes along the triples it gets for process info by setting the OS in the llvm::Triple correctly <rdar://problem/17060217> llvm-svn: 209852
Diffstat (limited to 'lldb/source/Core/ArchSpec.cpp')
-rw-r--r--lldb/source/Core/ArchSpec.cpp32
1 files changed, 28 insertions, 4 deletions
diff --git a/lldb/source/Core/ArchSpec.cpp b/lldb/source/Core/ArchSpec.cpp
index 6d708f158ed..82764699b8c 100644
--- a/lldb/source/Core/ArchSpec.cpp
+++ b/lldb/source/Core/ArchSpec.cpp
@@ -844,10 +844,34 @@ ArchSpec::IsEqualTo (const ArchSpec& rhs, bool exact_match) const
if (rhs_os_specified && lhs_os_specified)
return false;
}
- // Only fail if both os types are not unknown
- if (lhs_triple_os != llvm::Triple::UnknownOS &&
- rhs_triple_os != llvm::Triple::UnknownOS)
- return false;
+
+ bool ios_simulator_compatible = false;
+ // Check for iOS desktop simulator matches where:
+ // x86_64-apple-ios is compatible with x86_64-apple-macosx
+ // i386-apple-ios is compatible with i386-apple-macosx
+ if (lhs_triple_vendor == llvm::Triple::Apple)
+ {
+ const llvm::Triple::ArchType lhs_arch = lhs_triple.getArch();
+ if (lhs_arch == llvm::Triple::x86_64 ||
+ lhs_arch == llvm::Triple::x86)
+ {
+ if ((lhs_triple_os == llvm::Triple::MacOSX && rhs_triple_os == llvm::Triple::IOS ) ||
+ (lhs_triple_os == llvm::Triple::IOS && rhs_triple_os == llvm::Triple::MacOSX ))
+ {
+ ios_simulator_compatible = true;
+ }
+
+ }
+ }
+
+ // Only fail if both os types are not unknown or if we determined the triples
+ // match for x86_64 or x86 iOS simulator
+ if (!ios_simulator_compatible)
+ {
+ if (lhs_triple_os != llvm::Triple::UnknownOS &&
+ rhs_triple_os != llvm::Triple::UnknownOS)
+ return false;
+ }
}
const llvm::Triple::EnvironmentType lhs_triple_env = lhs_triple.getEnvironment();
OpenPOWER on IntegriCloud