forked from OSchip/llvm-project
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. llvm-svn: 166652
This commit is contained in:
parent
ade609770e
commit
840f12cf6b
|
@ -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 ()
|
||||
{
|
||||
|
|
|
@ -223,6 +223,9 @@ public:
|
|||
lldb_private::UUID
|
||||
GetUUID ();
|
||||
|
||||
bool
|
||||
RemoteIsEFI ();
|
||||
|
||||
lldb::addr_t
|
||||
GetLoadAddress ();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue