[Lldb-commits] [lldb] r176311 - Report the kernel slide when attaching to a darwin kernel debug session.

Jason Molenda jmolenda at apple.com
Thu Feb 28 16:06:37 PST 2013


Author: jmolenda
Date: Thu Feb 28 18:06:37 2013
New Revision: 176311

URL: http://llvm.org/viewvc/llvm-project?rev=176311&view=rev
Log:
Report the kernel slide when attaching to a darwin kernel debug session.

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=176311&r1=176310&r2=176311&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp Thu Feb 28 18:06:37 2013
@@ -918,6 +918,15 @@ DynamicLoaderDarwinKernel::KextImageInfo
         Stream *s = &target.GetDebugger().GetOutputStream();
         if (s)
         {
+            ObjectFile *kernel_object_file = m_module_sp->GetObjectFile();
+            if (kernel_object_file)
+            {
+                addr_t file_address = kernel_object_file->GetHeaderAddress().GetFileAddress();
+                if (m_load_address != LLDB_INVALID_ADDRESS && file_address != LLDB_INVALID_ADDRESS)
+                {
+                    s->Printf ("Kernel slid 0x%llx in memory.\n", m_load_address - file_address);
+                }
+            }
             if (m_module_sp->GetFileSpec().GetDirectory().IsEmpty())
             {
                 s->Printf ("Loaded kernel file %s\n", m_module_sp->GetFileSpec().GetFilename().AsCString());





More information about the lldb-commits mailing list