blob: 627942796507c71d003ccb6e5f30b78e445dedf6 [file] [log] [blame]
Eugene Zelenko9394d7722016-02-18 00:10:17 +00001//===-- MemoryHistory.cpp ---------------------------------------*- C++ -*-===//
Kuba Breckabeed8212014-09-04 01:03:18 +00002//
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 Zelenko9394d7722016-02-18 00:10:17 +000010// C Includes
11// C++ Includes
12// Other libraries and framework includes
13// Project includes
Kuba Breckabeed8212014-09-04 01:03:18 +000014#include "lldb/Target/MemoryHistory.h"
Kuba Breckabeed8212014-09-04 01:03:18 +000015#include "lldb/Core/PluginManager.h"
16
17using namespace lldb;
18using namespace lldb_private;
19
Kate Stoneb9c1b512016-09-06 20:57:50 +000020lldb::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 Breckabeed8212014-09-04 01:03:18 +000033}