blob: 3dc4435990169078150d39b69a763a85e70dde93 [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/lldb-private.h"
15#include "lldb/Core/PluginManager.h"
16#include "lldb/Core/PluginInterface.h"
17#include "lldb/Target/UnwindAssembly.h"
18
19using namespace lldb;
20using namespace lldb_private;
21
Jean-Daniel Dupas36b5eea2014-02-03 23:49:47 +000022UnwindAssemblySP
Greg Clayton7be25422011-04-25 21:14:26 +000023UnwindAssembly::FindPlugin (const ArchSpec &arch)
24{
25 UnwindAssemblyCreateInstance create_callback;
26
27 for (uint32_t idx = 0;
Eugene Zelenkod70a6e72016-02-18 18:52:47 +000028 (create_callback = PluginManager::GetUnwindAssemblyCreateCallbackAtIndex(idx)) != nullptr;
Greg Clayton7be25422011-04-25 21:14:26 +000029 ++idx)
30 {
Jean-Daniel Dupas36b5eea2014-02-03 23:49:47 +000031 UnwindAssemblySP assembly_profiler_ap (create_callback (arch));
Eugene Zelenkod70a6e72016-02-18 18:52:47 +000032 if (assembly_profiler_ap)
Jean-Daniel Dupas36b5eea2014-02-03 23:49:47 +000033 return assembly_profiler_ap;
Greg Clayton7be25422011-04-25 21:14:26 +000034 }
Eugene Zelenkod70a6e72016-02-18 18:52:47 +000035 return nullptr;
Greg Clayton7be25422011-04-25 21:14:26 +000036}
37
Greg Clayton2ed751b2011-04-26 04:39:08 +000038UnwindAssembly::UnwindAssembly (const ArchSpec &arch) :
39 m_arch (arch)
Greg Clayton7be25422011-04-25 21:14:26 +000040{
41}
42
Eugene Zelenkod70a6e72016-02-18 18:52:47 +000043UnwindAssembly::~UnwindAssembly() = default;