blob: b3b2393b0234636bd4d25f5902968c3b7538e5da [file] [log] [blame]
Kuba Breckaafdf8422014-10-10 23:43:03 +00001//===-- InstrumentationRuntime.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/lldb-private.h"
11#include "lldb/Target/Process.h"
12#include "lldb/Core/PluginManager.h"
13#include "lldb/Target/InstrumentationRuntime.h"
14
15using namespace lldb;
16using namespace lldb_private;
17
18void
19InstrumentationRuntime::ModulesDidLoad(lldb_private::ModuleList &module_list, lldb_private::Process *process, InstrumentationRuntimeCollection &runtimes)
20{
21 InstrumentationRuntimeCreateInstance create_callback = NULL;
22 InstrumentationRuntimeGetType get_type_callback;
23 for (uint32_t idx = 0; ; ++idx)
24 {
25 create_callback = PluginManager::GetInstrumentationRuntimeCreateCallbackAtIndex(idx);
26 if (create_callback == NULL)
27 break;
28 get_type_callback = PluginManager::GetInstrumentationRuntimeGetTypeCallbackAtIndex(idx);
29 InstrumentationRuntimeType type = get_type_callback();
30
31 InstrumentationRuntimeCollection::iterator pos;
32 pos = runtimes.find (type);
33 if (pos == runtimes.end()) {
34 runtimes[type] = create_callback(process->shared_from_this());
35 }
36 }
37}
38
39void
40InstrumentationRuntime::ModulesDidLoad(lldb_private::ModuleList &module_list)
41{
42}
43
44bool
45InstrumentationRuntime::IsActive()
46{
47 return false;
48}