[Lldb-commits] [lldb] r166652 - in /lldb/trunk/source/Plugins/Process/MacOSX-Kernel: CommunicationKDP.cpp CommunicationKDP.h ProcessKDP.cpp

Jason Molenda jmolenda at apple.com
Wed Oct 24 17:25:13 PDT 2012


Author: jmolenda
Date: Wed Oct 24 19:25:13 2012
New Revision: 166652

URL: http://llvm.org/viewvc/llvm-project?rev=166652&view=rev
Log:
Identify a kdp session that is connecting to an EFI monitor,
use a DynamicLoaderStatic dynamic loader for the session
instead of a kernel or user dynamic loader.

Modified:
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp

Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp?rev=166652&r1=166651&r2=166652&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp Wed Oct 24 19:25:13 2012
@@ -525,6 +525,17 @@
     return uuid;
 }
 
+bool
+CommunicationKDP::RemoteIsEFI ()
+{
+    if (GetKernelVersion() == NULL)
+        return false;
+    if (strncmp (m_kernel_version.c_str(), "EFI", 3) == 0)
+        return true;
+    else
+        return false;
+}
+
 lldb::addr_t
 CommunicationKDP::GetLoadAddress ()
 {

Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h?rev=166652&r1=166651&r2=166652&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h Wed Oct 24 19:25:13 2012
@@ -223,6 +223,9 @@
     lldb_private::UUID 
     GetUUID ();
 
+    bool
+    RemoteIsEFI ();
+
     lldb::addr_t
     GetLoadAddress ();
 

Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp?rev=166652&r1=166651&r2=166652&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp Wed Oct 24 19:25:13 2012
@@ -38,6 +38,7 @@
 #include "ProcessKDPLog.h"
 #include "ThreadKDP.h"
 #include "Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h"
+#include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h"
 #include "Utility/StringExtractor.h"
 
 using namespace lldb;
@@ -229,12 +230,17 @@
                     kernel_arch.SetArchitecture(eArchTypeMachO, cpu, sub);
                     m_target.SetArchitecture(kernel_arch);
 
-                    /* Get the kernel's UUID and load address via kdp-kernelversion packet.  */
-                        
+                    /* Get the kernel's UUID and load address via KDP_KERNELVERSION packet.  */
+                    /* An EFI kdp session has neither UUID nor load address. */
+
                     UUID kernel_uuid = m_comm.GetUUID ();
                     addr_t kernel_load_addr = m_comm.GetLoadAddress ();
 
-                    if (kernel_load_addr != LLDB_INVALID_ADDRESS)
+                    if (m_comm.RemoteIsEFI ())
+                    {
+                        m_dyld_plugin_name = DynamicLoaderStatic::GetPluginNameStatic();
+                    }
+                    else if (kernel_load_addr != LLDB_INVALID_ADDRESS)
                     {
                         m_kernel_load_addr = kernel_load_addr;
                         m_dyld_plugin_name = DynamicLoaderDarwinKernel::GetPluginNameStatic();





More information about the lldb-commits mailing list