[Lldb-commits] [lldb] b8a8c2d - Allow DynamicLoaderDarwinKernel to activate without binary

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 10 10:19:18 PDT 2022


Author: Jason Molenda
Date: 2022-10-10T10:19:09-07:00
New Revision: b8a8c2d47a38ba08012fe9cbb28169a1e0f7be2a

URL: https://github.com/llvm/llvm-project/commit/b8a8c2d47a38ba08012fe9cbb28169a1e0f7be2a
DIFF: https://github.com/llvm/llvm-project/commit/b8a8c2d47a38ba08012fe9cbb28169a1e0f7be2a.diff

LOG: Allow DynamicLoaderDarwinKernel to activate without binary

In https://reviews.llvm.org/D133534 I made a little cleanup
to DynamicLoaderDarwinKernel::CreateInstance and unintentionally
changed the logic.  Previously it would not create an instance
if there was a binary given to lldb and it was not a kernel.
With my change, the absence of any binary would also cause it
to not create.  So connecting to a kernel without any binaries
would fail.

rdar://100985097

Added: 
    

Modified: 
    lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 533585a9b8d18..b0617ce3159c7 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -152,7 +152,8 @@ DynamicLoader *DynamicLoaderDarwinKernel::CreateInstance(Process *process,
   if (!force) {
     // If the user provided an executable binary and it is not a kernel, this
     // plugin should not create an instance.
-    if (!is_kernel(process->GetTarget().GetExecutableModulePointer()))
+    Module *exec = process->GetTarget().GetExecutableModulePointer();
+    if (exec && !is_kernel(exec))
       return nullptr;
 
     // If the target's architecture does not look like an Apple environment,


        


More information about the lldb-commits mailing list