summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Sezer <sas@cd80.net>2015-07-08 18:07:13 +0000
committerStephane Sezer <sas@cd80.net>2015-07-08 18:07:13 +0000
commitf0af7a707bd948f903299b1459b569e14be9fabf (patch)
tree172ce8a409cc1018440bf8aa3279d224c177bc76
parent8a701b3d5436fedda6452d1f2d8070cd37ad5e4f (diff)
Move WindowsDYLD to the Plugins/DynamicLoader directory.
Summary: 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. Test Plan: Build. Reviewers: zturner Subscribers: lldb-commits, abdulras Differential Revision: http://reviews.llvm.org/D10882 git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@241697 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--cmake/LLDBDependencies.cmake1
-rw-r--r--source/API/SystemInitializerFull.cpp5
-rw-r--r--source/Initialization/SystemInitializerCommon.cpp3
-rw-r--r--source/Plugins/DynamicLoader/CMakeLists.txt2
-rw-r--r--source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt5
-rw-r--r--source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp (renamed from source/Plugins/Process/Windows/DynamicLoaderWindows.cpp)36
-rw-r--r--source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h (renamed from source/Plugins/Process/Windows/DynamicLoaderWindows.h)12
-rw-r--r--source/Plugins/Process/Windows/CMakeLists.txt1
8 files changed, 34 insertions, 31 deletions
diff --git a/cmake/LLDBDependencies.cmake b/cmake/LLDBDependencies.cmake
index d53ce2a98..96f6bcc2b 100644
--- a/cmake/LLDBDependencies.cmake
+++ b/cmake/LLDBDependencies.cmake
@@ -19,6 +19,7 @@ set( LLDB_USED_LIBS
lldbPluginDynamicLoaderStatic
lldbPluginDynamicLoaderPosixDYLD
lldbPluginDynamicLoaderHexagonDYLD
+ lldbPluginDynamicLoaderWindowsDYLD
lldbPluginObjectFileELF
lldbPluginObjectFileJIT
diff --git a/source/API/SystemInitializerFull.cpp b/source/API/SystemInitializerFull.cpp
index 731d38a37..01ad81576 100644
--- a/source/API/SystemInitializerFull.cpp
+++ b/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 @@ SystemInitializerFull::Initialize()
RenderScriptRuntime::Initialize();
#if defined(_MSC_VER)
- DynamicLoaderWindows::Initialize();
ProcessWindows::Initialize();
#endif
#if defined(__FreeBSD__)
@@ -369,9 +367,6 @@ SystemInitializerFull::Terminate()
ProcessKDP::Terminate();
SymbolVendorMacOSX::Terminate();
#endif
-#if defined(_MSC_VER)
- DynamicLoaderWindows::Terminate();
-#endif
#if defined(__FreeBSD__)
ProcessFreeBSD::Terminate();
diff --git a/source/Initialization/SystemInitializerCommon.cpp b/source/Initialization/SystemInitializerCommon.cpp
index 35189c103..51f32a277 100644
--- a/source/Initialization/SystemInitializerCommon.cpp
+++ b/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 @@ SystemInitializerCommon::Initialize()
ObjectFileELF::Initialize();
ObjectFilePECOFF::Initialize();
DynamicLoaderPOSIXDYLD::Initialize();
+ DynamicLoaderWindowsDYLD::Initialize();
platform_freebsd::PlatformFreeBSD::Initialize();
platform_linux::PlatformLinux::Initialize();
PlatformWindows::Initialize();
@@ -152,6 +154,7 @@ SystemInitializerCommon::Terminate()
ObjectFileELF::Terminate();
ObjectFilePECOFF::Terminate();
DynamicLoaderPOSIXDYLD::Terminate();
+ DynamicLoaderWindowsDYLD::Terminate();
platform_freebsd::PlatformFreeBSD::Terminate();
platform_linux::PlatformLinux::Terminate();
PlatformWindows::Terminate();
diff --git a/source/Plugins/DynamicLoader/CMakeLists.txt b/source/Plugins/DynamicLoader/CMakeLists.txt
index 01a08cba6..8e1b316a3 100644
--- a/source/Plugins/DynamicLoader/CMakeLists.txt
+++ b/source/Plugins/DynamicLoader/CMakeLists.txt
@@ -2,8 +2,8 @@ add_subdirectory(MacOSX-DYLD)
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()
-
diff --git a/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt b/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt
new file mode 100644
index 000000000..9a5ad7682
--- /dev/null
+++ b/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt
@@ -0,0 +1,5 @@
+set(LLVM_NO_RTTI 1)
+
+add_lldb_library(lldbPluginDynamicLoaderWindowsDYLD
+ DynamicLoaderWindowsDYLD.cpp
+ )
diff --git a/source/Plugins/Process/Windows/DynamicLoaderWindows.cpp b/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
index 552f75841..56b56ab3a 100644
--- a/source/Plugins/Process/Windows/DynamicLoaderWindows.cpp
+++ b/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
@@ -1,4 +1,4 @@
-//===-- DynamicLoaderWindows.cpp --------------------------------*- C++ -*-===//
+//===-- DynamicLoaderWindowsDYLD.cpp --------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,8 +7,7 @@
//
//===----------------------------------------------------------------------===//
-#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 @@ DynamicLoader *DynamicLoaderWindows::CreateInstance(Process *process, bool force
}
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
+}
diff --git a/source/Plugins/Process/Windows/DynamicLoaderWindows.h b/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h
index 304c6f8f6..d12b999f4 100644
--- a/source/Plugins/Process/Windows/DynamicLoaderWindows.h
+++ b/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h
@@ -1,4 +1,4 @@
-//===-- DynamicLoaderWindows.h ----------------------------------*- C++ -*-===//
+//===-- DynamicLoaderWindowsDYLDh ----------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#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"
@@ -16,11 +16,11 @@
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();
diff --git a/source/Plugins/Process/Windows/CMakeLists.txt b/source/Plugins/Process/Windows/CMakeLists.txt
index c0f210e0d..6d61fef7f 100644
--- a/source/Plugins/Process/Windows/CMakeLists.txt
+++ b/source/Plugins/Process/Windows/CMakeLists.txt
@@ -5,7 +5,6 @@ include_directories(../Utility)
set(PROC_WINDOWS_SOURCES
DebuggerThread.cpp
- DynamicLoaderWindows.cpp
LocalDebugDelegate.cpp
ProcessWindows.cpp
ProcessWindowsLog.cpp