1*80814287SRaphael Isemann //===-- UnwindAssembly.cpp ------------------------------------------------===// 27be2542fSGreg Clayton // 32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information. 52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 67be2542fSGreg Clayton // 77be2542fSGreg Clayton //===----------------------------------------------------------------------===// 87be2542fSGreg Clayton 97be2542fSGreg Clayton #include "lldb/Target/UnwindAssembly.h" 10b9c1b51eSKate Stone #include "lldb/Core/PluginInterface.h" 11b9c1b51eSKate Stone #include "lldb/Core/PluginManager.h" 12b9c1b51eSKate Stone #include "lldb/lldb-private.h" 137be2542fSGreg Clayton 147be2542fSGreg Clayton using namespace lldb; 157be2542fSGreg Clayton using namespace lldb_private; 167be2542fSGreg Clayton FindPlugin(const ArchSpec & arch)17b9c1b51eSKate StoneUnwindAssemblySP UnwindAssembly::FindPlugin(const ArchSpec &arch) { 187be2542fSGreg Clayton UnwindAssemblyCreateInstance create_callback; 197be2542fSGreg Clayton 207be2542fSGreg Clayton for (uint32_t idx = 0; 21b9c1b51eSKate Stone (create_callback = PluginManager::GetUnwindAssemblyCreateCallbackAtIndex( 22b9c1b51eSKate Stone idx)) != nullptr; 23b9c1b51eSKate Stone ++idx) { 24d5b44036SJonas Devlieghere UnwindAssemblySP assembly_profiler_up(create_callback(arch)); 25d5b44036SJonas Devlieghere if (assembly_profiler_up) 26d5b44036SJonas Devlieghere return assembly_profiler_up; 277be2542fSGreg Clayton } 28d70a6e71SEugene Zelenko return nullptr; 297be2542fSGreg Clayton } 307be2542fSGreg Clayton UnwindAssembly(const ArchSpec & arch)31b9c1b51eSKate StoneUnwindAssembly::UnwindAssembly(const ArchSpec &arch) : m_arch(arch) {} 32