Eugene Zelenko | d70a6e7 | 2016-02-18 18:52:47 +0000 | [diff] [blame] | 1 | //===-- UnwindAssembly.cpp --------------------------------------*- C++ -*-===// |
Greg Clayton | 7be2542 | 2011-04-25 21:14:26 +0000 | [diff] [blame] | 2 | // |
| 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 Zelenko | d70a6e7 | 2016-02-18 18:52:47 +0000 | [diff] [blame] | 10 | // C Includes |
| 11 | // C++ Includes |
| 12 | // Other libraries and framework includes |
| 13 | // Project includes |
Greg Clayton | 7be2542 | 2011-04-25 21:14:26 +0000 | [diff] [blame] | 14 | #include "lldb/lldb-private.h" |
| 15 | #include "lldb/Core/PluginManager.h" |
| 16 | #include "lldb/Core/PluginInterface.h" |
| 17 | #include "lldb/Target/UnwindAssembly.h" |
| 18 | |
| 19 | using namespace lldb; |
| 20 | using namespace lldb_private; |
| 21 | |
Jean-Daniel Dupas | 36b5eea | 2014-02-03 23:49:47 +0000 | [diff] [blame] | 22 | UnwindAssemblySP |
Greg Clayton | 7be2542 | 2011-04-25 21:14:26 +0000 | [diff] [blame] | 23 | UnwindAssembly::FindPlugin (const ArchSpec &arch) |
| 24 | { |
| 25 | UnwindAssemblyCreateInstance create_callback; |
| 26 | |
| 27 | for (uint32_t idx = 0; |
Eugene Zelenko | d70a6e7 | 2016-02-18 18:52:47 +0000 | [diff] [blame] | 28 | (create_callback = PluginManager::GetUnwindAssemblyCreateCallbackAtIndex(idx)) != nullptr; |
Greg Clayton | 7be2542 | 2011-04-25 21:14:26 +0000 | [diff] [blame] | 29 | ++idx) |
| 30 | { |
Jean-Daniel Dupas | 36b5eea | 2014-02-03 23:49:47 +0000 | [diff] [blame] | 31 | UnwindAssemblySP assembly_profiler_ap (create_callback (arch)); |
Eugene Zelenko | d70a6e7 | 2016-02-18 18:52:47 +0000 | [diff] [blame] | 32 | if (assembly_profiler_ap) |
Jean-Daniel Dupas | 36b5eea | 2014-02-03 23:49:47 +0000 | [diff] [blame] | 33 | return assembly_profiler_ap; |
Greg Clayton | 7be2542 | 2011-04-25 21:14:26 +0000 | [diff] [blame] | 34 | } |
Eugene Zelenko | d70a6e7 | 2016-02-18 18:52:47 +0000 | [diff] [blame] | 35 | return nullptr; |
Greg Clayton | 7be2542 | 2011-04-25 21:14:26 +0000 | [diff] [blame] | 36 | } |
| 37 | |
Greg Clayton | 2ed751b | 2011-04-26 04:39:08 +0000 | [diff] [blame] | 38 | UnwindAssembly::UnwindAssembly (const ArchSpec &arch) : |
| 39 | m_arch (arch) |
Greg Clayton | 7be2542 | 2011-04-25 21:14:26 +0000 | [diff] [blame] | 40 | { |
| 41 | } |
| 42 | |
Eugene Zelenko | d70a6e7 | 2016-02-18 18:52:47 +0000 | [diff] [blame] | 43 | UnwindAssembly::~UnwindAssembly() = default; |