Author: jmolenda
Date: Wed Mar  6 15:47:52 2019
New Revision: 355565

URL: http://llvm.org/viewvc/llvm-project?rev=355565&view=rev
Log:
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> 


Modified:
    
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=355565&r1=355564&r2=355565&view=diff
==============================================================================
--- 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 Wed Mar  6 15:47:52 2019
@@ -873,14 +873,6 @@ bool DynamicLoaderDarwinKernel::KextImag
     }
   }
 
-  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::ParseKex
     }
   }
 
+  int failed_to_load_kexts = 0;
   if (number_of_new_kexts_being_added > 0) {
     ModuleList loaded_module_list;
 
@@ -1305,6 +1298,7 @@ bool DynamicLoaderDarwinKernel::ParseKex
         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::ParseKex
   }
 
   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();
   }
 


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to