Author: jmolenda
Date: Thu Feb  4 19:38:56 2016
New Revision: 259865

URL: http://llvm.org/viewvc/llvm-project?rev=259865&view=rev
Log:
Add two more addresses to check for the address of the kernel in debug mode;
also add some logging about where lldb is lookin for a kernel as it connects.
<rdar://problem/24454582> 

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=259865&r1=259864&r2=259865&view=diff
==============================================================================
--- 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 Thu Feb  4 19:38:56 2016
@@ -266,6 +266,16 @@ DynamicLoaderDarwinKernel::SearchForKern
         {
             return addr;
         }
+        addr = process->ReadUnsignedIntegerFromMemory (0xfffffff000002010ULL, 
8, LLDB_INVALID_ADDRESS, read_err);
+        if (CheckForKernelImageAtAddress (addr, process).IsValid())
+        {
+            return addr;
+        }
+        addr = process->ReadUnsignedIntegerFromMemory (0xfffffff000004010ULL, 
8, LLDB_INVALID_ADDRESS, read_err);
+        if (CheckForKernelImageAtAddress (addr, process).IsValid())
+        {
+            return addr;
+        }
     }
     else
     {
@@ -397,9 +407,13 @@ DynamicLoaderDarwinKernel::SearchForKern
 lldb_private::UUID
 DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress (lldb::addr_t addr, 
Process *process)
 {
+    Log *log(lldb_private::GetLogIfAnyCategoriesSet 
(LIBLLDB_LOG_DYNAMIC_LOADER));
     if (addr == LLDB_INVALID_ADDRESS)
         return UUID();
 
+    if (log)
+        log->Printf ("DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress: 
looking for kernel binary at 0x%" PRIx64, addr);
+
     // First try a quick test -- read the first 4 bytes and see if there is a 
valid Mach-O magic field there
     // (the first field of the mach_header/mach_header_64 struct).
 
@@ -450,6 +464,8 @@ DynamicLoaderDarwinKernel::CheckForKerne
             {
                 process->GetTarget().SetArchitecture (kernel_arch);
             }
+            if (log)
+                log->Printf 
("DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress: kernel binary image 
found at 0x%" PRIx64, addr);
             return memory_module_sp->GetUUID();
         }
     }


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

Reply via email to