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 // 8 //===---------------------------------------------------------------------===// 9 10 // C Includes 11 // C++ Includes 12 // Other libraries and framework includes 13 // Project includes 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 { 25 InstrumentationRuntimeCreateInstance create_callback = nullptr; 26 InstrumentationRuntimeGetType get_type_callback; 27 for (uint32_t idx = 0; ; ++idx) 28 { 29 create_callback = PluginManager::GetInstrumentationRuntimeCreateCallbackAtIndex(idx); 30 if (create_callback == nullptr) 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 lldb::ThreadCollectionSP 44 InstrumentationRuntime::GetBacktracesFromExtendedStopInfo(StructuredData::ObjectSP info) 45 { 46 return ThreadCollectionSP(new ThreadCollection()); 47 } 48