1 //===-- UnwindAssembly.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 // C Includes
11 // C++ Includes
12 // Other libraries and framework includes
13 // Project includes
14 #include "lldb/lldb-private.h"
15 #include "lldb/Core/PluginManager.h"
16 #include "lldb/Core/PluginInterface.h"
17 #include "lldb/Target/UnwindAssembly.h"
18 
19 using namespace lldb;
20 using namespace lldb_private;
21 
22 UnwindAssemblySP
23 UnwindAssembly::FindPlugin (const ArchSpec &arch)
24 {
25     UnwindAssemblyCreateInstance create_callback;
26 
27     for (uint32_t idx = 0;
28          (create_callback = PluginManager::GetUnwindAssemblyCreateCallbackAtIndex(idx)) != nullptr;
29          ++idx)
30     {
31         UnwindAssemblySP assembly_profiler_ap (create_callback (arch));
32         if (assembly_profiler_ap)
33             return assembly_profiler_ap;
34     }
35     return nullptr;
36 }
37 
38 UnwindAssembly::UnwindAssembly (const ArchSpec &arch) :
39     m_arch (arch)
40 {
41 }
42 
43 UnwindAssembly::~UnwindAssembly() = default;
44