1 //===-- DynamicLoader.cpp ---------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "lldb/lldb-private.h"
11 #include "lldb/Target/DynamicLoader.h"
12 #include "lldb/Target/Process.h"
13 #include "lldb/Core/PluginManager.h"
16 using namespace lldb_private;
19 DynamicLoader::FindPlugin (Process *process, const char *plugin_name)
21 DynamicLoaderCreateInstance create_callback = NULL;
24 ConstString const_plugin_name(plugin_name);
25 create_callback = PluginManager::GetDynamicLoaderCreateCallbackForPluginName (const_plugin_name);
28 std::unique_ptr<DynamicLoader> instance_ap(create_callback(process, true));
29 if (instance_ap.get())
30 return instance_ap.release();
35 for (uint32_t idx = 0; (create_callback = PluginManager::GetDynamicLoaderCreateCallbackAtIndex(idx)) != NULL; ++idx)
37 std::unique_ptr<DynamicLoader> instance_ap(create_callback(process, false));
38 if (instance_ap.get())
39 return instance_ap.release();
46 //----------------------------------------------------------------------
47 // DynamicLoader constructor
48 //----------------------------------------------------------------------
49 DynamicLoader::DynamicLoader(Process *process) :
54 //----------------------------------------------------------------------
56 //----------------------------------------------------------------------
57 DynamicLoader::~DynamicLoader()
61 //----------------------------------------------------------------------
62 // Accessosors to the global setting as to whether to stop at image
63 // (shared library) loading/unloading.
64 //----------------------------------------------------------------------
66 DynamicLoader::GetStopWhenImagesChange () const
68 return m_process->GetStopOnSharedLibraryEvents();
72 DynamicLoader::SetStopWhenImagesChange (bool stop)
74 m_process->SetStopOnSharedLibraryEvents (stop);