summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/Target/DynamicLoader.h4
-rw-r--r--lldb/include/lldb/Target/Process.h1
-rw-r--r--lldb/source/Core/DynamicLoader.cpp7
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp7
4 files changed, 19 insertions, 0 deletions
diff --git a/lldb/include/lldb/Target/DynamicLoader.h b/lldb/include/lldb/Target/DynamicLoader.h
index 9d37e943f0a..e620746e7bd 100644
--- a/lldb/include/lldb/Target/DynamicLoader.h
+++ b/lldb/include/lldb/Target/DynamicLoader.h
@@ -331,6 +331,10 @@ protected:
// Read a pointer from memory at the given addr.
// Return LLDB_INVALID_ADDRESS if the read fails.
lldb::addr_t ReadPointer(lldb::addr_t addr);
+
+ // Calls into the Process protected method LoadOperatingSystemPlugin:
+ void LoadOperatingSystemPlugin(bool flush);
+
//------------------------------------------------------------------
// Member variables.
diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h
index 0c3fc0770de..cf076d1abd6 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -505,6 +505,7 @@ class Process : public std::enable_shared_from_this<Process>,
public PluginInterface {
friend class FunctionCaller; // For WaitForStateChangeEventsPrivate
friend class Debugger; // For PopProcessIOHandler and ProcessIOHandlerIsActive
+ friend class DynamicLoader; // For LoadOperatingSystemPlugin
friend class ProcessEventData;
friend class StopInfo;
friend class Target;
diff --git a/lldb/source/Core/DynamicLoader.cpp b/lldb/source/Core/DynamicLoader.cpp
index 69c5ea30dad..667cf7c8668 100644
--- a/lldb/source/Core/DynamicLoader.cpp
+++ b/lldb/source/Core/DynamicLoader.cpp
@@ -233,3 +233,10 @@ addr_t DynamicLoader::ReadPointer(addr_t addr) {
else
return value;
}
+
+void DynamicLoader::LoadOperatingSystemPlugin(bool flush)
+{
+ if (m_process)
+ m_process->LoadOperatingSystemPlugin(flush);
+}
+
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index b7010303bca..255210b756e 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -25,6 +25,7 @@
#include "lldb/Host/Symbols.h"
#include "lldb/Interpreter/OptionValueProperties.h"
#include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Target/OperatingSystem.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Target.h"
@@ -1026,6 +1027,12 @@ void DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded() {
m_kernel.LoadImageAtFileAddress(m_process);
}
}
+
+ // The operating system plugin gets loaded and initialized in
+ // LoadImageUsingMemoryModule when we discover the kernel dSYM. For a
+ // core file in particular, that's the wrong place to do this, since
+ // we haven't fixed up the section addresses yet. So let's redo it here.
+ LoadOperatingSystemPlugin(false);
if (m_kernel.IsLoaded() && m_kernel.GetModule()) {
static ConstString kext_summary_symbol("gLoadedKextSummaries");
OpenPOWER on IntegriCloud