Skip to content

Commit 22e9753

Browse files
committed
Don't load kexts/kernels without dSYMs present
One of the backup schemes I use for finding kexts and kernels on the local filesystem is to load a solitary binary when I don't find any with a dSYM. This usually is a more confusing behavior than helpful; people expect to get no binary loaded, or a binary with debug information. This change stops loading kexts and kernels that do not have an associated dSYM. rdar://74291888
1 parent 9f9a4df commit 22e9753

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -791,21 +791,6 @@ Status PlatformDarwinKernel::GetSharedModuleKext(
791791
return error;
792792
}
793793

794-
// Lastly, look through the kext binarys without dSYMs
795-
if (m_name_to_kext_path_map_without_dsyms.count(kext_bundle) > 0) {
796-
for (BundleIDToKextIterator it =
797-
m_name_to_kext_path_map_without_dsyms.begin();
798-
it != m_name_to_kext_path_map_without_dsyms.end(); ++it) {
799-
if (it->first == kext_bundle) {
800-
error = ExamineKextForMatchingUUID(it->second, module_spec.GetUUID(),
801-
module_spec.GetArchitecture(),
802-
module_sp);
803-
if (module_sp.get()) {
804-
return error;
805-
}
806-
}
807-
}
808-
}
809794
return error;
810795
}
811796

@@ -884,33 +869,6 @@ Status PlatformDarwinKernel::GetSharedModuleKernel(
884869
return error;
885870
}
886871

887-
// Lastly, try all kernel binaries that don't have a dSYM
888-
for (auto possible_kernel : m_kernel_binaries_without_dsyms) {
889-
if (FileSystem::Instance().Exists(possible_kernel)) {
890-
ModuleSpec kern_spec(possible_kernel);
891-
kern_spec.GetUUID() = module_spec.GetUUID();
892-
module_sp.reset(new Module(kern_spec));
893-
if (module_sp && module_sp->GetObjectFile() &&
894-
module_sp->MatchesModuleSpec(kern_spec)) {
895-
// module_sp is an actual kernel binary we want to add.
896-
if (process) {
897-
process->GetTarget().GetImages().AppendIfNeeded(module_sp);
898-
error.Clear();
899-
return error;
900-
} else {
901-
error = ModuleList::GetSharedModule(kern_spec, module_sp, nullptr,
902-
nullptr, nullptr);
903-
if (module_sp && module_sp->GetObjectFile() &&
904-
module_sp->GetObjectFile()->GetType() !=
905-
ObjectFile::Type::eTypeCoreFile) {
906-
return error;
907-
}
908-
module_sp.reset();
909-
}
910-
}
911-
}
912-
}
913-
914872
return error;
915873
}
916874

0 commit comments

Comments
 (0)