[Lldb-commits] [lldb] r264794 - LLDB top of tree SVN fails to attach to a MacOSX native process by pid only (no executable).

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 29 15:09:24 PDT 2016


Author: gclayton
Date: Tue Mar 29 17:09:24 2016
New Revision: 264794

URL: http://llvm.org/viewvc/llvm-project?rev=264794&view=rev
Log:
LLDB top of tree SVN fails to attach to a MacOSX native process by pid only (no executable). 

The problem was that the static DynamicLoaderDarwinKernel::Initialize() was recently changed to come before DynamicLoaderMacOSXDYLD::Initialize() which caused the DynamicLoaderDarwinKernel::CreateInstance(...) to be called before DynamicLoaderMacOSXDYLD::CreateInstance(...) and DynamicLoaderDarwinKernel would claim it could be the dynamic loader for a user space MacOSX process. The fix is to make DynamicLoaderDarwinKernel::CreateInstance() a bit more thourough when vetting the process so that it doesn't claim MacOSX user space processes.

<rdar://problem/25425373> 


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

Modified: lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=264794&r1=264793&r2=264794&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp Tue Mar 29 17:09:24 2016
@@ -181,8 +181,8 @@ DynamicLoaderDarwinKernel::CreateInstanc
     // 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)
+    const addr_t kernel_load_address = SearchForDarwinKernel (process);
+    if (CheckForKernelImageAtAddress (kernel_load_address, process).IsValid())
     {
         process->SetCanRunCode(false);
         return new DynamicLoaderDarwinKernel (process, kernel_load_address);




More information about the lldb-commits mailing list