1 //===-- OperatingSystem.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 //===----------------------------------------------------------------------===//
11 #include "lldb/Target/OperatingSystem.h"
14 // Other libraries and framework includes
15 #include "lldb/Core/PluginManager.h"
16 #include "lldb/Target/Thread.h"
19 using namespace lldb_private;
23 OperatingSystem::FindPlugin (Process *process, const char *plugin_name)
25 OperatingSystemCreateInstance create_callback = NULL;
28 ConstString const_plugin_name(plugin_name);
29 create_callback = PluginManager::GetOperatingSystemCreateCallbackForPluginName (const_plugin_name);
32 std::unique_ptr<OperatingSystem> instance_ap(create_callback(process, true));
33 if (instance_ap.get())
34 return instance_ap.release();
39 for (uint32_t idx = 0; (create_callback = PluginManager::GetOperatingSystemCreateCallbackAtIndex(idx)) != NULL; ++idx)
41 std::unique_ptr<OperatingSystem> instance_ap(create_callback(process, false));
42 if (instance_ap.get())
43 return instance_ap.release();
50 OperatingSystem::OperatingSystem (Process *process) :
55 OperatingSystem::~OperatingSystem()
61 OperatingSystem::IsOperatingSystemPluginThread (const lldb::ThreadSP &thread_sp)
64 return thread_sp->IsOperatingSystemPluginThread();