[all-commits] [llvm/llvm-project] 8faca2: [lldb] Fix platform selection on Apple Silicon

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Fri Jan 14 16:04:01 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8faca2ed6adebffa76c6eb506f15dfd38ab512a7
      https://github.com/llvm/llvm-project/commit/8faca2ed6adebffa76c6eb506f15dfd38ab512a7
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

  Changed paths:
    M lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
    M lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformRemoteMacOSX.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h

  Log Message:
  -----------
  [lldb] Fix platform selection on Apple Silicon

Currently, when connecting to a remote iOS device from the command line
on Apple Silicon, we end up using the host platform (PlatfromMacOSX)
instead of remote-ios (PlatformRemoteiOS). This happens because
PlatfromMacOSX includes arm64-apple-ios and arm64e-apple-ios as
compatible architectures, presumably to support debugging iOS Apps on
Apple Silicon [1].

This is a problem for debugging remote ios devices, because the host
platform doesn't look for an expanded shared cache on disk and as a
result we end up reading everything from memory, incurring a significant
performance hit.

The crux of this patch is to make PlatfromMacOSX *not* compatible with
arm64(e)-apple-ios. This also means that we now use remote-ios
(PlatformRemoteiOS) as the platform for debugging iOS apps on Apple
Silicon. This has the (unintended) side effect that unlike we do for the
host platform, we no longer check our local shared cache, and incur a
performance hit on debugging these apps.

To avoid that, PlatformRemoteiOS now also check the local cache to
support this use case, which is cheap enough to do unconditionally for
PlatformRemoteiOS.

[1] https://support.apple.com/guide/app-store/iphone-ipad-apps-mac-apple-silicon-fird2c7092da/mac

Differential revision: https://reviews.llvm.org/D117340




More information about the All-commits mailing list