]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/source/Target/MemoryHistory.cpp
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / source / Target / MemoryHistory.cpp
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 #include "lldb/Core/PluginManager.h"
12
13 using namespace lldb;
14 using namespace lldb_private;
15
16 lldb::MemoryHistorySP MemoryHistory::FindPlugin(const ProcessSP process) {
17   MemoryHistoryCreateInstance create_callback = nullptr;
18
19   for (uint32_t idx = 0;
20        (create_callback = PluginManager::GetMemoryHistoryCreateCallbackAtIndex(
21             idx)) != nullptr;
22        ++idx) {
23     MemoryHistorySP memory_history_sp(create_callback(process));
24     if (memory_history_sp)
25       return memory_history_sp;
26   }
27
28   return MemoryHistorySP();
29 }