[Lldb-commits] [PATCH] D122684: [lldb] Use the selected and host platform to disambiguate between fat binary architectures

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 29 14:00:39 PDT 2022


JDevlieghere created this revision.
JDevlieghere added reviewers: labath, jingham, clayborg, jasonmolenda.
Herald added subscribers: mgrang, mgorny.
Herald added a project: All.
JDevlieghere requested review of this revision.

Currently we error out if multiple platforms can supports the architectures in a fat binary. For example, on Darwin, almost every architecture supported by the host platform is also supported by the remote-macosx platform. Currently, the only way to disambiguate between the two is to specify the desired architecture.

This patch changes the behavior to account for the selected and host platform. The new algorithm to pick a platform works as follows:

1. Prefer the selected platform if it supports all architectures in the binary,
2. Prefer the host platform if it supports all architectures in the binary,
3. Prefer the platform that supports all architectures in the binary,
4. Prefer the selected platform if it supports one architecture in the binary,
5. Prefer the host platform if it supports one architecture in the binary,
6. If none of the above apply, error out saying either no or multiple platforms support the architectures in the binary

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


https://reviews.llvm.org/D122684

Files:
  lldb/include/lldb/Target/Platform.h
  lldb/source/Target/Platform.cpp
  lldb/source/Target/TargetList.cpp
  lldb/unittests/Platform/CMakeLists.txt
  lldb/unittests/Platform/PlatformTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122684.418972.patch
Type: text/x-patch
Size: 16346 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220329/9f0eb57c/attachment-0001.bin>


More information about the lldb-commits mailing list