Jason Molenda | eef5106 | 2013-11-05 03:57:19 +0000 | [diff] [blame] | 1 | //===-- SystemRuntime.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 | |
Eugene Zelenko | d70a6e7 | 2016-02-18 18:52:47 +0000 | [diff] [blame] | 10 | // C Includes |
| 11 | // C++ Includes |
| 12 | // Other libraries and framework includes |
| 13 | // Project includes |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 +0000 | [diff] [blame] | 14 | #include "lldb/lldb-private.h" |
| 15 | #include "lldb/Target/SystemRuntime.h" |
| 16 | #include "lldb/Target/Process.h" |
| 17 | #include "lldb/Core/PluginManager.h" |
| 18 | |
| 19 | using namespace lldb; |
| 20 | using namespace lldb_private; |
| 21 | |
| 22 | SystemRuntime* |
| 23 | SystemRuntime::FindPlugin (Process *process) |
| 24 | { |
Eugene Zelenko | d70a6e7 | 2016-02-18 18:52:47 +0000 | [diff] [blame] | 25 | SystemRuntimeCreateInstance create_callback = nullptr; |
| 26 | for (uint32_t idx = 0; (create_callback = PluginManager::GetSystemRuntimeCreateCallbackAtIndex(idx)) != nullptr; ++idx) |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 +0000 | [diff] [blame] | 27 | { |
| 28 | std::unique_ptr<SystemRuntime> instance_ap(create_callback(process)); |
Eugene Zelenko | d70a6e7 | 2016-02-18 18:52:47 +0000 | [diff] [blame] | 29 | if (instance_ap) |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 +0000 | [diff] [blame] | 30 | return instance_ap.release(); |
| 31 | } |
Eugene Zelenko | d70a6e7 | 2016-02-18 18:52:47 +0000 | [diff] [blame] | 32 | return nullptr; |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 +0000 | [diff] [blame] | 33 | } |
| 34 | |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 +0000 | [diff] [blame] | 35 | //---------------------------------------------------------------------- |
| 36 | // SystemRuntime constructor |
| 37 | //---------------------------------------------------------------------- |
| 38 | SystemRuntime::SystemRuntime(Process *process) : |
Jason Molenda | 750ea69 | 2013-11-12 07:02:07 +0000 | [diff] [blame] | 39 | m_process (process), |
| 40 | m_types () |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 +0000 | [diff] [blame] | 41 | { |
| 42 | } |
| 43 | |
Eugene Zelenko | d70a6e7 | 2016-02-18 18:52:47 +0000 | [diff] [blame] | 44 | SystemRuntime::~SystemRuntime() = default; |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 +0000 | [diff] [blame] | 45 | |
| 46 | void |
| 47 | SystemRuntime::DidAttach () |
| 48 | { |
| 49 | } |
| 50 | |
| 51 | void |
| 52 | SystemRuntime::DidLaunch() |
| 53 | { |
| 54 | } |
| 55 | |
| 56 | void |
Jason Molenda | 2fd8335 | 2014-02-05 05:44:54 +0000 | [diff] [blame] | 57 | SystemRuntime::Detach() |
| 58 | { |
| 59 | } |
| 60 | |
| 61 | void |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 +0000 | [diff] [blame] | 62 | SystemRuntime::ModulesDidLoad (ModuleList &module_list) |
| 63 | { |
| 64 | } |
| 65 | |
Jason Molenda | 750ea69 | 2013-11-12 07:02:07 +0000 | [diff] [blame] | 66 | const std::vector<ConstString> & |
Jason Molenda | 95d005c | 2013-11-06 03:07:33 +0000 | [diff] [blame] | 67 | SystemRuntime::GetExtendedBacktraceTypes () |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 +0000 | [diff] [blame] | 68 | { |
Jason Molenda | 750ea69 | 2013-11-12 07:02:07 +0000 | [diff] [blame] | 69 | return m_types; |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 +0000 | [diff] [blame] | 70 | } |
Jason Molenda | 5dd4916 | 2013-11-06 00:04:44 +0000 | [diff] [blame] | 71 | |
| 72 | ThreadSP |
Jason Molenda | 008c45f | 2013-11-12 23:33:32 +0000 | [diff] [blame] | 73 | SystemRuntime::GetExtendedBacktraceThread (ThreadSP thread, ConstString type) |
Jason Molenda | 5dd4916 | 2013-11-06 00:04:44 +0000 | [diff] [blame] | 74 | { |
| 75 | return ThreadSP(); |
| 76 | } |