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 // C Includes
11 // C++ Includes
12 // Other libraries and framework includes
13 // Project includes
14 #include "lldb/Target/MemoryHistory.h"
15 #include "lldb/Core/PluginManager.h"
16 
17 using namespace lldb;
18 using namespace lldb_private;
19 
20 lldb::MemoryHistorySP
21 MemoryHistory::FindPlugin (const ProcessSP process)
22 {
23     MemoryHistoryCreateInstance create_callback = nullptr;
24 
25     for (uint32_t idx = 0; (create_callback = PluginManager::GetMemoryHistoryCreateCallbackAtIndex(idx)) != nullptr; ++idx)
26     {
27         MemoryHistorySP memory_history_sp (create_callback (process));
28         if (memory_history_sp)
29             return memory_history_sp;
30     }
31 
32     return MemoryHistorySP();
33 }
34