Raphael Isemann | 8081428 | 2020-01-24 07:23:27 | [diff] [blame] | 1 | //===-- SystemRuntime.cpp -------------------------------------------------===// |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 | [diff] [blame] | 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 | [diff] [blame] | 9 | #include "lldb/Target/SystemRuntime.h" |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 | [diff] [blame] | 10 | #include "lldb/Core/PluginManager.h" |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 | [diff] [blame] | 11 | #include "lldb/Target/Process.h" |
| 12 | #include "lldb/lldb-private.h" |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 | [diff] [blame] | 13 | |
| 14 | using namespace lldb; |
| 15 | using namespace lldb_private; |
| 16 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 | [diff] [blame] | 17 | SystemRuntime *SystemRuntime::FindPlugin(Process *process) { |
| 18 | SystemRuntimeCreateInstance create_callback = nullptr; |
| 19 | for (uint32_t idx = 0; |
| 20 | (create_callback = PluginManager::GetSystemRuntimeCreateCallbackAtIndex( |
| 21 | idx)) != nullptr; |
| 22 | ++idx) { |
Jonas Devlieghere | d5b4403 | 2019-02-13 06:25:41 | [diff] [blame] | 23 | std::unique_ptr<SystemRuntime> instance_up(create_callback(process)); |
| 24 | if (instance_up) |
| 25 | return instance_up.release(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 | [diff] [blame] | 26 | } |
| 27 | return nullptr; |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 | [diff] [blame] | 28 | } |
| 29 | |
Jonas Devlieghere | 34d4c8a | 2020-07-24 23:20:55 | [diff] [blame] | 30 | SystemRuntime::SystemRuntime(Process *process) : Runtime(process), m_types() {} |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 | [diff] [blame] | 31 | |
Eugene Zelenko | d70a6e7 | 2016-02-18 18:52:47 | [diff] [blame] | 32 | SystemRuntime::~SystemRuntime() = default; |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 | [diff] [blame] | 33 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 | [diff] [blame] | 34 | void SystemRuntime::DidAttach() {} |
| 35 | |
| 36 | void SystemRuntime::DidLaunch() {} |
| 37 | |
| 38 | void SystemRuntime::Detach() {} |
| 39 | |
Jonas Devlieghere | 34d4c8a | 2020-07-24 23:20:55 | [diff] [blame] | 40 | void SystemRuntime::ModulesDidLoad(const ModuleList &module_list) {} |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 | [diff] [blame] | 41 | |
| 42 | const std::vector<ConstString> &SystemRuntime::GetExtendedBacktraceTypes() { |
| 43 | return m_types; |
Jason Molenda | eef5106 | 2013-11-05 03:57:19 | [diff] [blame] | 44 | } |
| 45 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 | [diff] [blame] | 46 | ThreadSP SystemRuntime::GetExtendedBacktraceThread(ThreadSP thread, |
| 47 | ConstString type) { |
| 48 | return ThreadSP(); |
Jason Molenda | 5dd4916 | 2013-11-06 00:04:44 | [diff] [blame] | 49 | } |