xref: /openbsd-src/gnu/llvm/lldb/source/Target/UnwindAssembly.cpp (revision be691f3bb6417f04a68938fadbcaee2d5795e764)
1*dda28197Spatrick //===-- UnwindAssembly.cpp ------------------------------------------------===//
2061da546Spatrick //
3061da546Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4061da546Spatrick // See https://llvm.org/LICENSE.txt for license information.
5061da546Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6061da546Spatrick //
7061da546Spatrick //===----------------------------------------------------------------------===//
8061da546Spatrick 
9061da546Spatrick #include "lldb/Target/UnwindAssembly.h"
10061da546Spatrick #include "lldb/Core/PluginInterface.h"
11061da546Spatrick #include "lldb/Core/PluginManager.h"
12061da546Spatrick #include "lldb/lldb-private.h"
13061da546Spatrick 
14061da546Spatrick using namespace lldb;
15061da546Spatrick using namespace lldb_private;
16061da546Spatrick 
FindPlugin(const ArchSpec & arch)17061da546Spatrick UnwindAssemblySP UnwindAssembly::FindPlugin(const ArchSpec &arch) {
18061da546Spatrick   UnwindAssemblyCreateInstance create_callback;
19061da546Spatrick 
20061da546Spatrick   for (uint32_t idx = 0;
21061da546Spatrick        (create_callback = PluginManager::GetUnwindAssemblyCreateCallbackAtIndex(
22061da546Spatrick             idx)) != nullptr;
23061da546Spatrick        ++idx) {
24061da546Spatrick     UnwindAssemblySP assembly_profiler_up(create_callback(arch));
25061da546Spatrick     if (assembly_profiler_up)
26061da546Spatrick       return assembly_profiler_up;
27061da546Spatrick   }
28061da546Spatrick   return nullptr;
29061da546Spatrick }
30061da546Spatrick 
UnwindAssembly(const ArchSpec & arch)31061da546Spatrick UnwindAssembly::UnwindAssembly(const ArchSpec &arch) : m_arch(arch) {}
32