blob: d3d8068687c0375e6650f5cdf399561a8065590e [file] [log] [blame]
Eugene Zelenkod70a6e72016-02-18 18:52:47 +00001//===-- UnwindAssembly.cpp --------------------------------------*- C++ -*-===//
Greg Clayton7be25422011-04-25 21:14:26 +00002//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Greg Clayton7be25422011-04-25 21:14:26 +00006//
7//===----------------------------------------------------------------------===//
8
Greg Clayton7be25422011-04-25 21:14:26 +00009#include "lldb/Target/UnwindAssembly.h"
Kate Stoneb9c1b512016-09-06 20:57:50 +000010#include "lldb/Core/PluginInterface.h"
11#include "lldb/Core/PluginManager.h"
12#include "lldb/lldb-private.h"
Greg Clayton7be25422011-04-25 21:14:26 +000013
14using namespace lldb;
15using namespace lldb_private;
16
Kate Stoneb9c1b512016-09-06 20:57:50 +000017UnwindAssemblySP UnwindAssembly::FindPlugin(const ArchSpec &arch) {
18 UnwindAssemblyCreateInstance create_callback;
Greg Clayton7be25422011-04-25 21:14:26 +000019
Kate Stoneb9c1b512016-09-06 20:57:50 +000020 for (uint32_t idx = 0;
21 (create_callback = PluginManager::GetUnwindAssemblyCreateCallbackAtIndex(
22 idx)) != nullptr;
23 ++idx) {
Jonas Devlieghered5b44032019-02-13 06:25:41 +000024 UnwindAssemblySP assembly_profiler_up(create_callback(arch));
25 if (assembly_profiler_up)
26 return assembly_profiler_up;
Kate Stoneb9c1b512016-09-06 20:57:50 +000027 }
28 return nullptr;
Greg Clayton7be25422011-04-25 21:14:26 +000029}
30
Kate Stoneb9c1b512016-09-06 20:57:50 +000031UnwindAssembly::UnwindAssembly(const ArchSpec &arch) : m_arch(arch) {}
Greg Clayton7be25422011-04-25 21:14:26 +000032
Eugene Zelenkod70a6e72016-02-18 18:52:47 +000033UnwindAssembly::~UnwindAssembly() = default;