Remap the target (Xcode) SDK directory to the host SDK directory.
authorAdrian Prantl <aprantl@apple.com>
Fri, 20 Mar 2020 01:51:36 +0000 (18:51 -0700)
committerAdrian Prantl <aprantl@apple.com>
Mon, 6 Apr 2020 22:51:30 +0000 (15:51 -0700)
commit1e05d7b3d3c6d29ff6f9493cc478a36244cc32bd
tree1609b9ccf80f3097d22ac71ec3528bc40bbd1910
parent276d2b78ce4d9753ed9e46576b4c5ab27d0ebf45
Remap the target (Xcode) SDK directory to the host SDK directory.

This is mostly useful for Swift support; it allows LLDB to substitute
a matching SDK it shipped with instead of the sysroot path that was
used at compile time.

The goal of this is to make the Xcode SDK something that behaves more
like the compiler's resource directory, as in that it ships with LLDB
rather than with the debugged program. This important primarily for
importing Swift and Clang modules in the expression evaluator, and
getting at the APINotes from the SDK in Swift.

For a cross-debugging scenario, this means you have to have an SDK for
your target installed alongside LLDB. In Xcode this will always be the
case.

rdar://problem/60640017

Differential Revision: https://reviews.llvm.org/D76471
22 files changed:
lldb/include/lldb/Core/Module.h
lldb/include/lldb/Host/HostInfoBase.h
lldb/include/lldb/Host/macosx/HostInfoMacOSX.h
lldb/include/lldb/Target/Platform.h
lldb/include/lldb/Utility/XcodeSDK.h [new file with mode: 0644]
lldb/source/Core/Module.cpp
lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h
lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h
lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h
lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h
lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h
lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/source/Utility/CMakeLists.txt
lldb/source/Utility/XcodeSDK.cpp [new file with mode: 0644]
lldb/unittests/Platform/PlatformDarwinTest.cpp
lldb/unittests/Utility/CMakeLists.txt
lldb/unittests/Utility/XcodeSDKTest.cpp [new file with mode: 0644]