Kuba Brecka | beed821 | 2014-09-04 01:03:18 +0000 | [diff] [blame] | 1 | //===-- MemoryHistory.cpp -------------------------*- C++ -*-===// |
| 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 | |
| 10 | #include "lldb/Target/MemoryHistory.h" |
| 11 | |
| 12 | #include "lldb/Core/PluginManager.h" |
| 13 | |
| 14 | using namespace lldb; |
| 15 | using namespace lldb_private; |
| 16 | |
| 17 | lldb::MemoryHistorySP |
| 18 | MemoryHistory::FindPlugin (const ProcessSP process) |
| 19 | { |
| 20 | MemoryHistoryCreateInstance create_callback = NULL; |
| 21 | |
| 22 | for (uint32_t idx = 0; (create_callback = PluginManager::GetMemoryHistoryCreateCallbackAtIndex(idx)) != NULL; ++idx) |
| 23 | { |
Jason Molenda | 48c0440 | 2014-10-16 16:59:23 +0000 | [diff] [blame] | 24 | MemoryHistorySP memory_history_sp (create_callback (process)); |
| 25 | if (memory_history_sp.get()) |
| 26 | return memory_history_sp; |
Kuba Brecka | beed821 | 2014-09-04 01:03:18 +0000 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | return MemoryHistorySP(); |
| 30 | } |