[Lldb-commits] [lldb] r219152 - Add another address to check for the kernel's load addr in debug configs.

Jason Molenda jmolenda at apple.com
Mon Oct 6 15:23:30 PDT 2014


Author: jmolenda
Date: Mon Oct  6 17:23:30 2014
New Revision: 219152

URL: http://llvm.org/viewvc/llvm-project?rev=219152&view=rev
Log:
Add another address to check for the kernel's load addr in debug configs.
<rdar://problem/18560328> 

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=219152&r1=219151&r2=219152&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp Mon Oct  6 17:23:30 2014
@@ -256,21 +256,24 @@ DynamicLoaderDarwinKernel::SearchForKern
     if (process->GetTarget().GetArchitecture().GetAddressByteSize() == 8)
     {
         addr = process->ReadUnsignedIntegerFromMemory (0xffffff8000002010ULL, 8, LLDB_INVALID_ADDRESS, read_err);
+        if (CheckForKernelImageAtAddress (addr, process).IsValid())
+        {
+            return addr;
+        }
+        addr = process->ReadUnsignedIntegerFromMemory (0xffffff8000004010ULL, 8, LLDB_INVALID_ADDRESS, read_err);
+        if (CheckForKernelImageAtAddress (addr, process).IsValid())
+        {
+            return addr;
+        }
     }
     else
     {
         addr = process->ReadUnsignedIntegerFromMemory (0xffff0110, 4, LLDB_INVALID_ADDRESS, read_err);
-    }
-
-    if (addr == 0)
-        addr = LLDB_INVALID_ADDRESS;
-
-    if (addr != LLDB_INVALID_ADDRESS)
-    {
         if (CheckForKernelImageAtAddress (addr, process).IsValid())
+        {
             return addr;
+        }
     }
-
     return LLDB_INVALID_ADDRESS;
 }
 





More information about the lldb-commits mailing list