Hi zturner, This commit moves the Windows DyanamicLoader to the common DynamicLoader directory. This is required to remote debug Windows targets.
This commit also initializes the Windows DYLD plugin in SystemInitializerCommon (similarly to both POSIX and MacOSX DYLD plugins) so that we can automatically instantiate this class when connected to a windows process. http://reviews.llvm.org/D10882 Files: cmake/LLDBDependencies.cmake source/API/SystemInitializerFull.cpp source/Initialization/SystemInitializerCommon.cpp source/Plugins/DynamicLoader/CMakeLists.txt source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h source/Plugins/Process/Windows/CMakeLists.txt source/Plugins/Process/Windows/DynamicLoaderWindows.cpp source/Plugins/Process/Windows/DynamicLoaderWindows.h EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/
Index: cmake/LLDBDependencies.cmake =================================================================== --- cmake/LLDBDependencies.cmake +++ cmake/LLDBDependencies.cmake @@ -19,6 +19,7 @@ lldbPluginDynamicLoaderStatic lldbPluginDynamicLoaderPosixDYLD lldbPluginDynamicLoaderHexagonDYLD + lldbPluginDynamicLoaderWindowsDYLD lldbPluginObjectFileELF lldbPluginObjectFileJIT Index: source/API/SystemInitializerFull.cpp =================================================================== --- source/API/SystemInitializerFull.cpp +++ source/API/SystemInitializerFull.cpp @@ -58,7 +58,6 @@ #if defined(_MSC_VER) #include "lldb/Host/windows/windows.h" -#include "Plugins/Process/Windows/DynamicLoaderWindows.h" #include "Plugins/Process/Windows/ProcessWindows.h" #endif @@ -264,7 +263,6 @@ RenderScriptRuntime::Initialize(); #if defined(_MSC_VER) - DynamicLoaderWindows::Initialize(); ProcessWindows::Initialize(); #endif #if defined(__FreeBSD__) @@ -369,9 +367,6 @@ ProcessKDP::Terminate(); SymbolVendorMacOSX::Terminate(); #endif -#if defined(_MSC_VER) - DynamicLoaderWindows::Terminate(); -#endif #if defined(__FreeBSD__) ProcessFreeBSD::Terminate(); Index: source/Initialization/SystemInitializerCommon.cpp =================================================================== --- source/Initialization/SystemInitializerCommon.cpp +++ source/Initialization/SystemInitializerCommon.cpp @@ -17,6 +17,7 @@ #include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h" #include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h" +#include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h" #include "Plugins/Instruction/ARM/EmulateInstructionARM.h" #include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h" #include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h" @@ -106,6 +107,7 @@ ObjectFileELF::Initialize(); ObjectFilePECOFF::Initialize(); DynamicLoaderPOSIXDYLD::Initialize(); + DynamicLoaderWindowsDYLD::Initialize(); PlatformFreeBSD::Initialize(); platform_linux::PlatformLinux::Initialize(); PlatformWindows::Initialize(); @@ -152,6 +154,7 @@ ObjectFileELF::Terminate(); ObjectFilePECOFF::Terminate(); DynamicLoaderPOSIXDYLD::Terminate(); + DynamicLoaderWindowsDYLD::Terminate(); PlatformFreeBSD::Terminate(); platform_linux::PlatformLinux::Terminate(); PlatformWindows::Terminate(); Index: source/Plugins/DynamicLoader/CMakeLists.txt =================================================================== --- source/Plugins/DynamicLoader/CMakeLists.txt +++ source/Plugins/DynamicLoader/CMakeLists.txt @@ -2,8 +2,8 @@ add_subdirectory(POSIX-DYLD) add_subdirectory(Static) add_subdirectory(Hexagon-DYLD) +add_subdirectory(Windows-DYLD) if (CMAKE_SYSTEM_NAME MATCHES "Darwin") add_subdirectory(Darwin-Kernel) endif() - Index: source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt =================================================================== --- /dev/null +++ source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt @@ -0,0 +1,5 @@ +set(LLVM_NO_RTTI 1) + +add_lldb_library(lldbPluginDynamicLoaderWindowsDYLD + DynamicLoaderWindowsDYLD.cpp + ) Index: source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp =================================================================== --- source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp +++ source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp @@ -1,14 +1,13 @@ -//===-- DynamicLoaderWindows.cpp --------------------------------*- C++ -*-===// +//===-- DynamicLoaderWindowsDYLD.cpp --------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -#include "DynamicLoaderWindows.h" -#include "ProcessWindowsLog.h" +#include "DynamicLoaderWindowsDYLD.h" #include "lldb/Core/PluginManager.h" #include "lldb/Target/Process.h" @@ -19,42 +18,43 @@ using namespace lldb; using namespace lldb_private; -DynamicLoaderWindows::DynamicLoaderWindows(Process *process) +DynamicLoaderWindowsDYLD::DynamicLoaderWindowsDYLD(Process *process) : DynamicLoader(process) { } -DynamicLoaderWindows::~DynamicLoaderWindows() +DynamicLoaderWindowsDYLD::~DynamicLoaderWindowsDYLD() { + } -void DynamicLoaderWindows::Initialize() +void DynamicLoaderWindowsDYLD::Initialize() { PluginManager::RegisterPlugin(GetPluginNameStatic(), GetPluginDescriptionStatic(), CreateInstance); } -void DynamicLoaderWindows::Terminate() +void DynamicLoaderWindowsDYLD::Terminate() { } -ConstString DynamicLoaderWindows::GetPluginNameStatic() +ConstString DynamicLoaderWindowsDYLD::GetPluginNameStatic() { static ConstString g_plugin_name("windows-dyld"); return g_plugin_name; } -const char *DynamicLoaderWindows::GetPluginDescriptionStatic() +const char *DynamicLoaderWindowsDYLD::GetPluginDescriptionStatic() { return "Dynamic loader plug-in that watches for shared library " "loads/unloads in Windows processes."; } -DynamicLoader *DynamicLoaderWindows::CreateInstance(Process *process, bool force) +DynamicLoader *DynamicLoaderWindowsDYLD::CreateInstance(Process *process, bool force) { bool should_create = force; if (!should_create) @@ -65,38 +65,38 @@ } if (should_create) - return new DynamicLoaderWindows (process); + return new DynamicLoaderWindowsDYLD (process); return nullptr; } -void DynamicLoaderWindows::DidAttach() +void DynamicLoaderWindowsDYLD::DidAttach() { } -void DynamicLoaderWindows::DidLaunch() +void DynamicLoaderWindowsDYLD::DidLaunch() { } -Error DynamicLoaderWindows::CanLoadImage() +Error DynamicLoaderWindowsDYLD::CanLoadImage() { return Error(); } -ConstString DynamicLoaderWindows::GetPluginName() +ConstString DynamicLoaderWindowsDYLD::GetPluginName() { return GetPluginNameStatic(); } -uint32_t DynamicLoaderWindows::GetPluginVersion() +uint32_t DynamicLoaderWindowsDYLD::GetPluginVersion() { return 1; } ThreadPlanSP -DynamicLoaderWindows::GetStepThroughTrampolinePlan(Thread &thread, bool stop) +DynamicLoaderWindowsDYLD::GetStepThroughTrampolinePlan(Thread &thread, bool stop) { return ThreadPlanSP(); -} \ No newline at end of file +} Index: source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h =================================================================== --- source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h +++ source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h @@ -1,26 +1,26 @@ -//===-- DynamicLoaderWindows.h ----------------------------------*- C++ -*-===// +//===-- DynamicLoaderWindowsDYLDh ----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -#ifndef liblldb_Plugins_Process_Windows_DynamicLoaderWindows_H_ -#define liblldb_Plugins_Process_Windows_DynamicLoaderWindows_H_ +#ifndef liblldb_Plugins_Process_Windows_DynamicLoaderWindowsDYLD_H_ +#define liblldb_Plugins_Process_Windows_DynamicLoaderWindowsDYLD_H_ #include "lldb/lldb-forward.h" #include "lldb/Target/DynamicLoader.h" namespace lldb_private { -class DynamicLoaderWindows : public DynamicLoader +class DynamicLoaderWindowsDYLD : public DynamicLoader { public: - DynamicLoaderWindows(Process *process); - virtual ~DynamicLoaderWindows(); + DynamicLoaderWindowsDYLD(Process *process); + virtual ~DynamicLoaderWindowsDYLD(); static void Initialize(); static void Terminate(); Index: source/Plugins/Process/Windows/CMakeLists.txt =================================================================== --- source/Plugins/Process/Windows/CMakeLists.txt +++ source/Plugins/Process/Windows/CMakeLists.txt @@ -5,7 +5,6 @@ set(PROC_WINDOWS_SOURCES DebuggerThread.cpp - DynamicLoaderWindows.cpp LocalDebugDelegate.cpp ProcessWindows.cpp ProcessWindowsLog.cpp
_______________________________________________ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits