Remove the warning in

DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule
which would list every kext that failed to load when doing kernel
debugging.  Instead, in DynamicLoaderDarwinKernel::ParseKextSummaries,
print a summary of how many kexts lldb was unable to load at the end.

I want to reduce the amount of output at the start of kernel debug
sessions a bit; we'll see if anyone really wanted to see the list of
which kexts specifically were unable to be loaded.

No functional change, only changing lldb's output at the start of
a kernel debug session.

<rdar://problem/48654569> 

llvm-svn: 355565
This commit is contained in:
Jason Molenda 2019-03-06 23:47:52 +00:00
parent 212c8ac23f
commit 2d6e6cbacc

View file

@ -873,14 +873,6 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule(
}
}
if (!m_module_sp && !IsKernel() && m_uuid.IsValid() && !m_name.empty()) {
Stream *s = target.GetDebugger().GetOutputFile().get();
if (s) {
s->Printf("warning: Can't find binary/dSYM for %s (%s)\n", m_name.c_str(),
m_uuid.GetAsString().c_str());
}
}
static ConstString g_section_name_LINKEDIT("__LINKEDIT");
if (m_memory_module_sp && m_module_sp) {
@ -1296,6 +1288,7 @@ bool DynamicLoaderDarwinKernel::ParseKextSummaries(
}
}
int failed_to_load_kexts = 0;
if (number_of_new_kexts_being_added > 0) {
ModuleList loaded_module_list;
@ -1305,6 +1298,7 @@ bool DynamicLoaderDarwinKernel::ParseKextSummaries(
KextImageInfo &image_info = kext_summaries[new_kext];
if (load_kexts) {
if (!image_info.LoadImageUsingMemoryModule(m_process)) {
failed_to_load_kexts++;
image_info.LoadImageAtFileAddress(m_process);
}
}
@ -1350,7 +1344,11 @@ bool DynamicLoaderDarwinKernel::ParseKextSummaries(
}
if (s && load_kexts) {
s->Printf(" done.\n");
s->Printf(" done.");
if (failed_to_load_kexts > 0 && number_of_new_kexts_being_added > 0)
s->Printf(" Failed to load %d of %d kexts.", failed_to_load_kexts,
number_of_new_kexts_being_added);
s->Printf("\n");
s->Flush();
}