blob: 3b2b7bf17025eecfc7e9e666aa76d41d1e090ba1 [file] [log] [blame]
Eugene Zelenkod70a6e72016-02-18 18:52:47 +00001//===-- UnwindAssembly.cpp --------------------------------------*- C++ -*-===//
Greg Clayton7be25422011-04-25 21:14:26 +00002//
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
Eugene Zelenkod70a6e72016-02-18 18:52:47 +000010// C Includes
11// C++ Includes
12// Other libraries and framework includes
13// Project includes
Greg Clayton7be25422011-04-25 21:14:26 +000014#include "lldb/Target/UnwindAssembly.h"
Kate Stoneb9c1b512016-09-06 20:57:50 +000015#include "lldb/Core/PluginInterface.h"
16#include "lldb/Core/PluginManager.h"
17#include "lldb/lldb-private.h"
Greg Clayton7be25422011-04-25 21:14:26 +000018
19using namespace lldb;
20using namespace lldb_private;
21
Kate Stoneb9c1b512016-09-06 20:57:50 +000022UnwindAssemblySP UnwindAssembly::FindPlugin(const ArchSpec &arch) {
23 UnwindAssemblyCreateInstance create_callback;
Greg Clayton7be25422011-04-25 21:14:26 +000024
Kate Stoneb9c1b512016-09-06 20:57:50 +000025 for (uint32_t idx = 0;
26 (create_callback = PluginManager::GetUnwindAssemblyCreateCallbackAtIndex(
27 idx)) != nullptr;
28 ++idx) {
29 UnwindAssemblySP assembly_profiler_ap(create_callback(arch));
30 if (assembly_profiler_ap)
31 return assembly_profiler_ap;
32 }
33 return nullptr;
Greg Clayton7be25422011-04-25 21:14:26 +000034}
35
Kate Stoneb9c1b512016-09-06 20:57:50 +000036UnwindAssembly::UnwindAssembly(const ArchSpec &arch) : m_arch(arch) {}
Greg Clayton7be25422011-04-25 21:14:26 +000037
Eugene Zelenkod70a6e72016-02-18 18:52:47 +000038UnwindAssembly::~UnwindAssembly() = default;