1 //===-- DynamicLoaderWindowsDYLD.cpp --------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "DynamicLoaderWindowsDYLD.h" 11 12 #include "lldb/Core/PluginManager.h" 13 #include "lldb/Target/Process.h" 14 #include "lldb/Target/Target.h" 15 16 #include "llvm/ADT/Triple.h" 17 18 using namespace lldb; 19 using namespace lldb_private; 20 21 DynamicLoaderWindowsDYLD::DynamicLoaderWindowsDYLD(Process *process) 22 : DynamicLoader(process) 23 { 24 25 } 26 27 DynamicLoaderWindowsDYLD::~DynamicLoaderWindowsDYLD() 28 { 29 30 } 31 32 void DynamicLoaderWindowsDYLD::Initialize() 33 { 34 PluginManager::RegisterPlugin(GetPluginNameStatic(), 35 GetPluginDescriptionStatic(), 36 CreateInstance); 37 } 38 39 void DynamicLoaderWindowsDYLD::Terminate() 40 { 41 42 } 43 44 ConstString DynamicLoaderWindowsDYLD::GetPluginNameStatic() 45 { 46 static ConstString g_plugin_name("windows-dyld"); 47 return g_plugin_name; 48 } 49 50 const char *DynamicLoaderWindowsDYLD::GetPluginDescriptionStatic() 51 { 52 return "Dynamic loader plug-in that watches for shared library " 53 "loads/unloads in Windows processes."; 54 } 55 56 57 DynamicLoader *DynamicLoaderWindowsDYLD::CreateInstance(Process *process, bool force) 58 { 59 bool should_create = force; 60 if (!should_create) 61 { 62 const llvm::Triple &triple_ref = process->GetTarget().GetArchitecture().GetTriple(); 63 if (triple_ref.getOS() == llvm::Triple::Win32) 64 should_create = true; 65 } 66 67 if (should_create) 68 return new DynamicLoaderWindowsDYLD (process); 69 70 return nullptr; 71 } 72 73 void DynamicLoaderWindowsDYLD::DidAttach() 74 { 75 76 } 77 78 void DynamicLoaderWindowsDYLD::DidLaunch() 79 { 80 81 } 82 83 Error DynamicLoaderWindowsDYLD::CanLoadImage() 84 { 85 return Error(); 86 } 87 88 ConstString DynamicLoaderWindowsDYLD::GetPluginName() 89 { 90 return GetPluginNameStatic(); 91 } 92 93 uint32_t DynamicLoaderWindowsDYLD::GetPluginVersion() 94 { 95 return 1; 96 } 97 98 ThreadPlanSP 99 DynamicLoaderWindowsDYLD::GetStepThroughTrampolinePlan(Thread &thread, bool stop) 100 { 101 return ThreadPlanSP(); 102 } 103