summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader')
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp10
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h6
2 files changed, 13 insertions, 3 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 247eb1695e7..667c9d7e13c 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -188,7 +188,14 @@ DynamicLoaderDarwinKernel::OSKextLoadedKextSummary::LoadImageUsingMemoryModule (
Target &target = process->GetTarget();
ModuleSP memory_module_sp;
- // Use the memory module as the module if we have one...
+
+ // If this is a kext and the user asked us to ignore kexts, don't try to load it.
+ if (kernel_image == false && target.GetDisableKextLoading() == true)
+ {
+ return false;
+ }
+
+ // Use the memory module as the module if we have one
if (address != LLDB_INVALID_ADDRESS)
{
FileSpec file_spec;
@@ -395,6 +402,7 @@ DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded()
{
m_kernel.Clear(false);
m_kernel.module_sp = m_process->GetTarget().GetExecutableModule();
+ m_kernel.kernel_image = true;
ConstString kernel_name("mach_kernel");
if (m_kernel.module_sp.get()
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
index 9a6f90f7984..9e2229f2647 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
@@ -136,7 +136,7 @@ protected:
char name[KERNEL_MODULE_MAX_NAME];
lldb::ModuleSP module_sp;
uint32_t load_process_stop_id;
- lldb_private::UUID uuid; // UUID for this dylib if it has one, else all zeros
+ lldb_private::UUID uuid; // UUID for this dylib if it has one, else all zeros
lldb_private::Address so_address; // The section offset address for this kext in case it can be read from object files
uint64_t address;
uint64_t size;
@@ -144,6 +144,7 @@ protected:
uint32_t load_tag;
uint32_t flags;
uint64_t reference_list;
+ bool kernel_image; // true if this is the kernel, false if this is a kext
OSKextLoadedKextSummary() :
module_sp (),
@@ -155,7 +156,8 @@ protected:
version (0),
load_tag (0),
flags (0),
- reference_list (0)
+ reference_list (0),
+ kernel_image (false)
{
name[0] = '\0';
}
OpenPOWER on IntegriCloud