summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2014-07-16 21:16:27 +0000
committerGreg Clayton <gclayton@apple.com>2014-07-16 21:16:27 +0000
commita1bce2ef1a2007c608d4a6948dd9aa991fd155df (patch)
treeeb20fca49b269abcf7aca8b9af070e653de01a19 /lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
parent31fb6f473006f3e1c61e8a118a10983ef48bd213 (diff)
downloadbcm5719-llvm-a1bce2ef1a2007c608d4a6948dd9aa991fd155df.tar.gz
bcm5719-llvm-a1bce2ef1a2007c608d4a6948dd9aa991fd155df.zip
Modify the EFI KDP debugging to not use any dynamic loader since it does manual dynamic loading itself via python modules.
Also track down the required binary by trying to locate the main executable module through LLDB's symbol and executable file locating code. <rdar://problem/16570258> llvm-svn: 213199
Diffstat (limited to 'lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp')
-rw-r--r--lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp36
1 files changed, 35 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
index c2ae2b962e5..8ed106ab065 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
@@ -297,7 +297,41 @@ ProcessKDP::DoConnectRemote (Stream *strm, const char *remote_url)
if (m_comm.RemoteIsEFI ())
{
- m_dyld_plugin_name = DynamicLoaderStatic::GetPluginNameStatic();
+ // Select an invalid plugin name for the dynamic loader so one doesn't get used
+ // since EFI does its own manual loading via python scripting
+ static ConstString g_none_dynamic_loader("none");
+ m_dyld_plugin_name = g_none_dynamic_loader;
+
+ if (kernel_uuid.IsValid()) {
+ // If EFI passed in a UUID= try to lookup UUID
+ // The slide will not be provided. But the UUID
+ // lookup will be used to launch EFI debug scripts
+ // from the dSYM, that can load all of the symbols.
+ ModuleSpec module_spec;
+ module_spec.GetUUID() = kernel_uuid;
+ module_spec.GetArchitecture() = m_target.GetArchitecture();
+
+ // Lookup UUID locally, before attempting dsymForUUID like action
+ module_spec.GetSymbolFileSpec() = Symbols::LocateExecutableSymbolFile(module_spec);
+ if (module_spec.GetSymbolFileSpec())
+ module_spec.GetFileSpec() = Symbols::LocateExecutableObjectFile (module_spec);
+ if (!module_spec.GetSymbolFileSpec() || !module_spec.GetSymbolFileSpec())
+ Symbols::DownloadObjectAndSymbolFile (module_spec, true);
+
+ if (module_spec.GetFileSpec().Exists())
+ {
+ ModuleSP module_sp(new Module (module_spec.GetFileSpec(), m_target.GetArchitecture()));
+ if (module_sp.get() && module_sp->MatchesModuleSpec (module_spec))
+ {
+ // Get the current target executable
+ ModuleSP exe_module_sp (m_target.GetExecutableModule ());
+
+ // Make sure you don't already have the right module loaded and they will be uniqued
+ if (exe_module_sp.get() != module_sp.get())
+ m_target.SetExecutableModule (module_sp, false);
+ }
+ }
+ }
}
else if (m_comm.RemoteIsDarwinKernel ())
{
OpenPOWER on IntegriCloud