LLDB now has a Kernel dynamic linker that can detect where kexts are
loaded. It locks onto *-apple-darwin binaries where the binary has
a "__KLD" segment. Soon I will modify the lldb_private::ObjectFile
class to return an executable type which will be an enum with values
something like:
eObjectFileTypeUserExectable,
eObjectFileTypeUserSharedLibrary,
eObjectFileTypeKernelExectable,
eObjectFileTypeKernelSharedLibrary,
eObjectFileTypeObjectFile,
eObjectFileTypeCoreFile

But for now we look at the section since a user and kernel mach-o
executable have the same mach-o file type.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134682 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/lldb.cpp b/source/lldb.cpp
index de6f169..97c9ec4 100644
--- a/source/lldb.cpp
+++ b/source/lldb.cpp
@@ -38,6 +38,7 @@
 
 #if defined (__APPLE__)
 #include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h"
+#include "Plugins/DynamicLoader/MacOSX-Kernel/DynamicLoaderMacOSXKernel.h"
 #include "Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h"
 #include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h"
 #include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h"
@@ -94,6 +95,7 @@
         // Apple/Darwin hosted plugins
         //----------------------------------------------------------------------
         DynamicLoaderMacOSXDYLD::Initialize();
+        DynamicLoaderMacOSXKernel::Initialize();
         SymbolFileDWARFDebugMap::Initialize();
         ItaniumABILanguageRuntime::Initialize();
         AppleObjCRuntimeV2::Initialize();
@@ -158,6 +160,7 @@
 
 #if defined (__APPLE__)
     DynamicLoaderMacOSXDYLD::Terminate();
+    DynamicLoaderMacOSXKernel::Terminate();
     SymbolFileDWARFDebugMap::Terminate();
     ItaniumABILanguageRuntime::Terminate();
     AppleObjCRuntimeV2::Terminate();