Eugene Zelenko | 9394d772 | 2016-02-18 00:10:17 +0000 | [diff] [blame] | 1 | //===-- MemoryHistory.cpp ---------------------------------------*- C++ -*-===// |
Kuba Brecka | beed821 | 2014-09-04 01:03:18 +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 | 9394d772 | 2016-02-18 00:10:17 +0000 | [diff] [blame] | 10 | // C Includes |
| 11 | // C++ Includes |
| 12 | // Other libraries and framework includes |
| 13 | // Project includes |
Kuba Brecka | beed821 | 2014-09-04 01:03:18 +0000 | [diff] [blame] | 14 | #include "lldb/Target/MemoryHistory.h" |
Kuba Brecka | beed821 | 2014-09-04 01:03:18 +0000 | [diff] [blame] | 15 | #include "lldb/Core/PluginManager.h" |
| 16 | |
| 17 | using namespace lldb; |
| 18 | using namespace lldb_private; |
| 19 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 20 | lldb::MemoryHistorySP MemoryHistory::FindPlugin(const ProcessSP process) { |
| 21 | MemoryHistoryCreateInstance create_callback = nullptr; |
| 22 | |
| 23 | for (uint32_t idx = 0; |
| 24 | (create_callback = PluginManager::GetMemoryHistoryCreateCallbackAtIndex( |
| 25 | idx)) != nullptr; |
| 26 | ++idx) { |
| 27 | MemoryHistorySP memory_history_sp(create_callback(process)); |
| 28 | if (memory_history_sp) |
| 29 | return memory_history_sp; |
| 30 | } |
| 31 | |
| 32 | return MemoryHistorySP(); |
Kuba Brecka | beed821 | 2014-09-04 01:03:18 +0000 | [diff] [blame] | 33 | } |