1cfca06d7SDimitry Andric //===-- UnwindAssembly.cpp ------------------------------------------------===// 2f034231aSEd Maste // 35f29bb8aSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 45f29bb8aSDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 55f29bb8aSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6f034231aSEd Maste // 7f034231aSEd Maste //===----------------------------------------------------------------------===// 8f034231aSEd Maste 9f034231aSEd Maste #include "lldb/Target/UnwindAssembly.h" 1014f1b3e8SDimitry Andric #include "lldb/Core/PluginInterface.h" 1114f1b3e8SDimitry Andric #include "lldb/Core/PluginManager.h" 1214f1b3e8SDimitry Andric #include "lldb/lldb-private.h" 13f034231aSEd Maste 14f034231aSEd Maste using namespace lldb; 15f034231aSEd Maste using namespace lldb_private; 16f034231aSEd Maste FindPlugin(const ArchSpec & arch)1714f1b3e8SDimitry AndricUnwindAssemblySP UnwindAssembly::FindPlugin(const ArchSpec &arch) { 18f034231aSEd Maste UnwindAssemblyCreateInstance create_callback; 19f034231aSEd Maste 20f034231aSEd Maste for (uint32_t idx = 0; 2114f1b3e8SDimitry Andric (create_callback = PluginManager::GetUnwindAssemblyCreateCallbackAtIndex( 2214f1b3e8SDimitry Andric idx)) != nullptr; 2314f1b3e8SDimitry Andric ++idx) { 245f29bb8aSDimitry Andric UnwindAssemblySP assembly_profiler_up(create_callback(arch)); 255f29bb8aSDimitry Andric if (assembly_profiler_up) 265f29bb8aSDimitry Andric return assembly_profiler_up; 27f034231aSEd Maste } 28f3fbd1c0SDimitry Andric return nullptr; 29f034231aSEd Maste } 30f034231aSEd Maste UnwindAssembly(const ArchSpec & arch)3114f1b3e8SDimitry AndricUnwindAssembly::UnwindAssembly(const ArchSpec &arch) : m_arch(arch) {} 32