summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp')
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index afa81cb66d8..2e865c1847b 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -177,6 +177,18 @@ DynamicLoaderDarwinKernel::CreateInstance (Process* process, bool force)
// At this point if there is an ExecutableModule, it is a kernel and the Target is some variant of an Apple system.
// If the Process hasn't provided the kernel load address, we need to look around in memory to find it.
+ addr_t kernel_load_address = SearchForDarwinKernel (process);
+ if (kernel_load_address != LLDB_INVALID_ADDRESS)
+ {
+ process->SetCanJIT(false);
+ return new DynamicLoaderDarwinKernel (process, kernel_load_address);
+ }
+ return NULL;
+}
+
+lldb::addr_t
+DynamicLoaderDarwinKernel::SearchForDarwinKernel (Process *process)
+{
addr_t kernel_load_address = process->GetImageInfoAddress();
if (kernel_load_address == LLDB_INVALID_ADDRESS)
{
@@ -194,13 +206,7 @@ DynamicLoaderDarwinKernel::CreateInstance (Process* process, bool force)
}
}
}
-
- if (kernel_load_address != LLDB_INVALID_ADDRESS)
- {
- process->SetCanJIT(false);
- return new DynamicLoaderDarwinKernel (process, kernel_load_address);
- }
- return NULL;
+ return kernel_load_address;
}
//----------------------------------------------------------------------
OpenPOWER on IntegriCloud