Kuba Brecka | afdf842 | 2014-10-10 23:43:03 +0000 | [diff] [blame] | 1 | //===-- 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 | // |
Eugene Zelenko | 9394d772 | 2016-02-18 00:10:17 +0000 | [diff] [blame^] | 8 | //===---------------------------------------------------------------------===// |
Kuba Brecka | afdf842 | 2014-10-10 23:43:03 +0000 | [diff] [blame] | 9 | |
Eugene Zelenko | 9394d772 | 2016-02-18 00:10:17 +0000 | [diff] [blame^] | 10 | // C Includes |
| 11 | // C++ Includes |
| 12 | // Other libraries and framework includes |
| 13 | // Project includes |
Kuba Brecka | afdf842 | 2014-10-10 23:43:03 +0000 | [diff] [blame] | 14 | #include "lldb/lldb-private.h" |
| 15 | #include "lldb/Target/Process.h" |
| 16 | #include "lldb/Core/PluginManager.h" |
| 17 | #include "lldb/Target/InstrumentationRuntime.h" |
| 18 | |
| 19 | using namespace lldb; |
| 20 | using namespace lldb_private; |
| 21 | |
| 22 | void |
| 23 | InstrumentationRuntime::ModulesDidLoad(lldb_private::ModuleList &module_list, lldb_private::Process *process, InstrumentationRuntimeCollection &runtimes) |
| 24 | { |
Eugene Zelenko | 9394d772 | 2016-02-18 00:10:17 +0000 | [diff] [blame^] | 25 | InstrumentationRuntimeCreateInstance create_callback = nullptr; |
Kuba Brecka | afdf842 | 2014-10-10 23:43:03 +0000 | [diff] [blame] | 26 | InstrumentationRuntimeGetType get_type_callback; |
| 27 | for (uint32_t idx = 0; ; ++idx) |
| 28 | { |
| 29 | create_callback = PluginManager::GetInstrumentationRuntimeCreateCallbackAtIndex(idx); |
Eugene Zelenko | 9394d772 | 2016-02-18 00:10:17 +0000 | [diff] [blame^] | 30 | if (create_callback == nullptr) |
Kuba Brecka | afdf842 | 2014-10-10 23:43:03 +0000 | [diff] [blame] | 31 | break; |
| 32 | get_type_callback = PluginManager::GetInstrumentationRuntimeGetTypeCallbackAtIndex(idx); |
| 33 | InstrumentationRuntimeType type = get_type_callback(); |
| 34 | |
| 35 | InstrumentationRuntimeCollection::iterator pos; |
| 36 | pos = runtimes.find (type); |
| 37 | if (pos == runtimes.end()) { |
| 38 | runtimes[type] = create_callback(process->shared_from_this()); |
| 39 | } |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | void |
| 44 | InstrumentationRuntime::ModulesDidLoad(lldb_private::ModuleList &module_list) |
| 45 | { |
| 46 | } |
| 47 | |
| 48 | bool |
| 49 | InstrumentationRuntime::IsActive() |
| 50 | { |
| 51 | return false; |
| 52 | } |