llvm-capstone/lldb/unittests
Michael Buch b0b2b6bab4 [lldb][PlatformDarwin] Parse SDK path for module compilation from debug-info
When we build the Clang module compilation command (e.g., when
a user requests import of a module via `expression @import Foundation`),
LLDB will try to determine which SDK directory to use as the `sysroot`.
However, it currently does so by simply enumerating the `SDKs` directory
and picking the last one that's appropriate for module compilation
(see `PlatformDarwin::GetSDKDirectoryForModules`). That means if we have
multiple platform SDKs installed (e.g., a public and internal one), we
may pick the wrong one by chance.

On Darwin platforms we emit the SDK path that a object
file was compiled against into DWARF (using `DW_AT_LLVM_sysroot`
and `DW_AT_APPLE_sdk`). For Swift debugging, we already parse the SDK
path from debug-info if we can.

This patch mimicks the Swift behaviour for non-Swift languages. I.e.,
if we can get the SDK path from debug-info, do so. Otherwise, fall back
to the old heuristic.

rdar://110407148

Differential Revision: https://reviews.llvm.org/D156020
2023-07-26 18:26:08 +01:00
..
API [lldb] Mark most SBAPI methods involving private types as protected or private 2023-05-10 12:36:55 -07:00
Breakpoint
Core [lldb] Add two-level caching in the source manager 2023-07-03 14:12:39 -07:00
DataFormatter [lldb] Remove remaining uses of llvm::Optional (NFC) 2023-01-07 14:36:35 -08:00
debugserver [lldb] [unittests] Fix TcpListen() call in RNBSocketTest 2021-10-26 21:08:03 +02:00
Disassembler Move GetControlFlowKind's logic to DisassemblerLLVMC.cpp 2022-07-26 12:05:23 -07:00
Editline Re-land "[lldb] Synchronize output through the IOHandler" 2022-03-15 12:53:46 -07:00
Expression [lldb] Consider OP_addrx in DWARFExpression::Update_DW_OP_addr 2023-07-21 16:42:16 -07:00
Host FileSystem::EnumerateDirectory should skip entries w/o Status, not halt 2023-06-26 17:46:53 -07:00
Instruction [lldb] Fix typo in LoongArch unittest 2023-02-07 15:09:04 +08:00
Interpreter [lldb][NFCI] Remove unneeded ConstString constructions for OptionValueProperties::AppendProperty 2023-06-26 11:06:29 -07:00
Language [unittest] Fix HighlighterTest.cpp after D151683 2023-07-22 18:30:02 -07:00
ObjectFile [lldb][ObjectFileELF] Set ModuleSpec file offset and size 2023-06-20 15:00:09 -07:00
Platform [lldb][Android] Add platform.plugin.remote-android.package-name 2023-06-20 16:17:21 -07:00
Process [lldb][test] Fix -Wsign-compare in GDBRemoteCommunicationClientTest.cpp (NFC) 2023-05-23 09:09:07 +08:00
ScriptInterpreter [lldb] Add support for negative integer to {SB,}StructuredData 2023-05-22 16:14:00 -07:00
Signals [lldb] Implement CrashReason using UnixSignals 2023-03-20 11:39:32 +00:00
Symbol [lldb] Add missing StringExtras.h includes 2023-07-13 21:06:25 +01:00
SymbolFile [lldb][PlatformDarwin] Parse SDK path for module compilation from debug-info 2023-07-26 18:26:08 +01:00
Target [lldb][LocateModuleCallback] Call locate module callback in Platform too 2023-07-25 10:57:50 -07:00
TestingSupport Use *{Map,Set}::contains (NFC) 2023-03-15 22:55:35 -07:00
Thread Revert "[lldb] Add Debugger & ScriptedMetadata reference to Platform::CreateInstance" 2023-01-13 09:13:03 -08:00
tools [lldb] Change parameter type of StructuredData::ParseJSON 2023-04-17 17:25:05 -07:00
UnwindAssembly Update the CFA to use $sp when $fp is restored on arm64 2022-05-04 14:54:17 -07:00
Utility [lldb][NFCI] Timer::DumpCategoryTimes should take a reference instead of a pointer 2023-06-26 10:36:41 -07:00
CMakeLists.txt [lldb/unittests/CMakeLists.txt] Remove extra compiler flag -include gtest_common.h, NFC 2022-12-02 10:45:49 -08:00
gtest_common.h