diff options
| author | Stephane Sezer <sas@cd80.net> | 2015-07-08 18:07:13 +0000 |
|---|---|---|
| committer | Stephane Sezer <sas@cd80.net> | 2015-07-08 18:07:13 +0000 |
| commit | 38a1b7ea58cc970505d35fe6e154a74352cc6d57 (patch) | |
| tree | 121199d065fb4aff940f412fa522cb60f8adae9e /lldb/source/Plugins/DynamicLoader | |
| parent | e008391ea2becf5963e141174335f7c3dfe7cbba (diff) | |
| download | bcm5719-llvm-38a1b7ea58cc970505d35fe6e154a74352cc6d57.tar.gz bcm5719-llvm-38a1b7ea58cc970505d35fe6e154a74352cc6d57.zip | |
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
llvm-svn: 241697
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader')
4 files changed, 151 insertions, 1 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/CMakeLists.txt b/lldb/source/Plugins/DynamicLoader/CMakeLists.txt index 01a08cba693..8e1b316a3c2 100644 --- a/lldb/source/Plugins/DynamicLoader/CMakeLists.txt +++ b/lldb/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/lldb/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt b/lldb/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt new file mode 100644 index 00000000000..9a5ad76827b --- /dev/null +++ b/lldb/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/lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp b/lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp new file mode 100644 index 00000000000..56b56ab3a19 --- /dev/null +++ b/lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp @@ -0,0 +1,102 @@ +//===-- 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 "DynamicLoaderWindowsDYLD.h" + +#include "lldb/Core/PluginManager.h" +#include "lldb/Target/Process.h" +#include "lldb/Target/Target.h" + +#include "llvm/ADT/Triple.h" + +using namespace lldb; +using namespace lldb_private; + +DynamicLoaderWindowsDYLD::DynamicLoaderWindowsDYLD(Process *process) + : DynamicLoader(process) +{ + +} + +DynamicLoaderWindowsDYLD::~DynamicLoaderWindowsDYLD() +{ + +} + +void DynamicLoaderWindowsDYLD::Initialize() +{ + PluginManager::RegisterPlugin(GetPluginNameStatic(), + GetPluginDescriptionStatic(), + CreateInstance); +} + +void DynamicLoaderWindowsDYLD::Terminate() +{ + +} + +ConstString DynamicLoaderWindowsDYLD::GetPluginNameStatic() +{ + static ConstString g_plugin_name("windows-dyld"); + return g_plugin_name; +} + +const char *DynamicLoaderWindowsDYLD::GetPluginDescriptionStatic() +{ + return "Dynamic loader plug-in that watches for shared library " + "loads/unloads in Windows processes."; +} + + +DynamicLoader *DynamicLoaderWindowsDYLD::CreateInstance(Process *process, bool force) +{ + bool should_create = force; + if (!should_create) + { + const llvm::Triple &triple_ref = process->GetTarget().GetArchitecture().GetTriple(); + if (triple_ref.getOS() == llvm::Triple::Win32) + should_create = true; + } + + if (should_create) + return new DynamicLoaderWindowsDYLD (process); + + return nullptr; +} + +void DynamicLoaderWindowsDYLD::DidAttach() +{ + +} + +void DynamicLoaderWindowsDYLD::DidLaunch() +{ + +} + +Error DynamicLoaderWindowsDYLD::CanLoadImage() +{ + return Error(); +} + +ConstString DynamicLoaderWindowsDYLD::GetPluginName() +{ + return GetPluginNameStatic(); +} + +uint32_t DynamicLoaderWindowsDYLD::GetPluginVersion() +{ + return 1; +} + +ThreadPlanSP +DynamicLoaderWindowsDYLD::GetStepThroughTrampolinePlan(Thread &thread, bool stop) +{ + return ThreadPlanSP(); +} diff --git a/lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h b/lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h new file mode 100644 index 00000000000..d12b999f462 --- /dev/null +++ b/lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h @@ -0,0 +1,43 @@ +//===-- 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_DynamicLoaderWindowsDYLD_H_ +#define liblldb_Plugins_Process_Windows_DynamicLoaderWindowsDYLD_H_ + +#include "lldb/lldb-forward.h" +#include "lldb/Target/DynamicLoader.h" + +namespace lldb_private +{ + +class DynamicLoaderWindowsDYLD : public DynamicLoader +{ + public: + DynamicLoaderWindowsDYLD(Process *process); + virtual ~DynamicLoaderWindowsDYLD(); + + static void Initialize(); + static void Terminate(); + static ConstString GetPluginNameStatic(); + static const char *GetPluginDescriptionStatic(); + + static DynamicLoader *CreateInstance(Process *process, bool force); + + void DidAttach () override; + void DidLaunch () override; + Error CanLoadImage () override; + lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread, bool stop) override; + + ConstString GetPluginName() override; + uint32_t GetPluginVersion() override; +}; + +} + +#endif |

