llvm-project/lldb/unittests/Platform
Jonas Devlieghere a114ec0c6d
[lldb] Change the way we pick a platform for fat binaries
Currently, when creating a target for a fat binary, we error out if more
than one platforms can support the different architectures in the
binary. There are situations where it makes sense for multiple platforms
to support the same architectures: for example the host and
remote-macosx platform on Darwin.

The only way to currently disambiguate between them is to specify the
architecture. This patch changes that to take into account the selected
and host platform. The new algorithm works a follows:

1. Pick the selected platform if it matches any of the architectures.
2. Pick the host platform if it matches any of the architectures.
3. If there's one platform that works for all architectures, pick that.

If none of the above apply then we either have no platform supporting
the architectures in the fat binary or multiple platforms with no good
way to disambiguate between them.

I've added a bunch of unit tests to codify this new behavior.

rdar://90360204

Differential revision: https://reviews.llvm.org/D122684
2022-03-30 15:30:05 -07:00
..
Android [lldb/Test] Fix unit test suffixes and add a CMake error. 2020-06-12 14:18:27 -07:00
tools [lldb] [Platform] Support synthesizing siginfo_t 2022-01-27 13:33:47 +01:00
CMakeLists.txt [lldb] Change the way we pick a platform for fat binaries 2022-03-30 15:30:05 -07:00
PlatformAppleSimulatorTest.cpp [lldb] Plumb process host architecture through platform selection 2022-03-14 12:17:01 -07:00
PlatformDarwinTest.cpp [lldb] Remove PlatformDarwin::GetCompatibleArch helper 2022-01-15 09:51:16 -08:00
PlatformMacOSXTest.cpp [lldb] Make the PlatformMacOSX unit test Apple specific 2022-03-15 09:32:56 -07:00
PlatformSiginfoTest.cpp [lldb] [Platform] Support synthesizing siginfo_t 2022-01-27 13:33:47 +01:00
PlatformTest.cpp [lldb] Change the way we pick a platform for fat binaries 2022-03-30 15:30:05 -07:00