Skip to content

Commit a511a88

Browse files
authored
Have kernel binary scanner load dSYMs as binary+dSYM if best thing found (#1896)
lldb's PlatforDarwinKernel scans the local filesystem (well known locations, plus user-specified directories) for kernels and kexts when doing kernel debugging, and loads them automatically. Sometimes kernel developers want to debug with *only* a dSYM, in which case they give lldb the DWARF binary + the dSYM as a binary and symbol file. This patch adds code to lldb to do this automatically if that's the best thing lldb can find. A few other bits of cleanup in PlatformDarwinKernel that I undertook at the same time: 1. Remove the 'platform.plugin.darwin-kernel.search-locally-for-kexts' setting. When I added the local filesystem index at start of kernel debugging, I thought people might object to the cost of the search and want a way to disable it. No one has. 2. Change the behavior of 'plugin.dynamic-loader.darwin-kernel.load-kexts' setting so it does not disable the local filesystem scan, or use of the local filesystem binaries. 3. PlatformDarwinKernel::GetSharedModule into GetSharedModuleKext and GetSharedModuleKernel for easier readability & maintenance. 4. Added accounting of .dSYM.yaa files (an archive format akin to tar) that I come across during the scan. I'm not using these for now; it would be very expensive to expand the archives & see if the UUID matches what I'm searching for. <rdar://problem/69774993> Differential Revision: https://reviews.llvm.org/D88632 (cherry picked from commit a1e9792)
1 parent bd2d456 commit a511a88

File tree

4 files changed

+318
-148
lines changed

4 files changed

+318
-148
lines changed

lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -517,12 +517,8 @@ DynamicLoaderDarwinKernel::DynamicLoaderDarwinKernel(Process *process,
517517
Status error;
518518
PlatformSP platform_sp(
519519
Platform::Create(PlatformDarwinKernel::GetPluginNameStatic(), error));
520-
// Only select the darwin-kernel Platform if we've been asked to load kexts.
521-
// It can take some time to scan over all of the kext info.plists and that
522-
// shouldn't be done if kext loading is explicitly disabled.
523-
if (platform_sp.get() && GetGlobalProperties()->GetLoadKexts()) {
520+
if (platform_sp.get())
524521
process->GetTarget().SetPlatform(platform_sp);
525-
}
526522
}
527523

528524
// Destructor

0 commit comments

Comments
 (0)