diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp index df5e535fe1d0..f7adc7ae7073 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp @@ -525,6 +525,17 @@ CommunicationKDP::GetUUID () 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 () { diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h index 1d2df321857a..eb1d036e8e85 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h @@ -223,6 +223,9 @@ public: lldb_private::UUID GetUUID (); + bool + RemoteIsEFI (); + lldb::addr_t GetLoadAddress (); diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp index d7de4138b4e0..3a7a0798e429 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp @@ -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 @@ ProcessKDP::DoConnectRemote (Stream *strm, const char *remote_url) 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();