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     {
24         MemoryHistorySP memory_history_sp (create_callback (process));
25         if (memory_history_sp.get())
26             return memory_history_sp;
27     }
28 
29     return MemoryHistorySP();
30 }
31