diff options
author | Jim Ingham <jingham@apple.com> | 2017-02-28 18:57:54 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2017-02-28 18:57:54 +0000 |
commit | 519b0816c6d9be5475cd99fcb994f30d96c1bcc8 (patch) | |
tree | e0543a1f4f9cbcfcf25e55103ea2954f830ae1a2 /lldb | |
parent | b691ccf0a5e59e285d87b51946b9dee144d74a96 (diff) | |
download | bcm5719-llvm-519b0816c6d9be5475cd99fcb994f30d96c1bcc8.tar.gz bcm5719-llvm-519b0816c6d9be5475cd99fcb994f30d96c1bcc8.zip |
Fix a bug in r294611 w.r.t. Darwin Kernel debugging.
<rdar://problem/30735021>
llvm-svn: 296504
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/include/lldb/Target/DynamicLoader.h | 4 | ||||
-rw-r--r-- | lldb/include/lldb/Target/Process.h | 1 | ||||
-rw-r--r-- | lldb/source/Core/DynamicLoader.cpp | 7 | ||||
-rw-r--r-- | lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp | 7 |
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"); |