/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | //===-- ScriptInterpreterNone.cpp -----------------------------------------===// |
2 | | // |
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 |
6 | | // |
7 | | //===----------------------------------------------------------------------===// |
8 | | |
9 | | #include "ScriptInterpreterNone.h" |
10 | | #include "lldb/Core/Debugger.h" |
11 | | #include "lldb/Core/PluginManager.h" |
12 | | #include "lldb/Utility/Stream.h" |
13 | | #include "lldb/Utility/StringList.h" |
14 | | |
15 | | #include "llvm/Support/Threading.h" |
16 | | |
17 | | #include <mutex> |
18 | | |
19 | | using namespace lldb; |
20 | | using namespace lldb_private; |
21 | | |
22 | | LLDB_PLUGIN_DEFINE(ScriptInterpreterNone) |
23 | | |
24 | | ScriptInterpreterNone::ScriptInterpreterNone(Debugger &debugger) |
25 | 7 | : ScriptInterpreter(debugger, eScriptLanguageNone) {} |
26 | | |
27 | 7 | ScriptInterpreterNone::~ScriptInterpreterNone() = default; |
28 | | |
29 | | bool ScriptInterpreterNone::ExecuteOneLine(llvm::StringRef command, |
30 | | CommandReturnObject *, |
31 | 0 | const ExecuteScriptOptions &) { |
32 | 0 | m_debugger.GetErrorStream().PutCString( |
33 | 0 | "error: there is no embedded script interpreter in this mode.\n"); |
34 | 0 | return false; |
35 | 0 | } |
36 | | |
37 | 0 | void ScriptInterpreterNone::ExecuteInterpreterLoop() { |
38 | 0 | m_debugger.GetErrorStream().PutCString( |
39 | 0 | "error: there is no embedded script interpreter in this mode.\n"); |
40 | 0 | } |
41 | | |
42 | 4.03k | void ScriptInterpreterNone::Initialize() { |
43 | 4.03k | static llvm::once_flag g_once_flag; |
44 | | |
45 | 4.03k | llvm::call_once(g_once_flag, []() { |
46 | 3.92k | PluginManager::RegisterPlugin(GetPluginNameStatic(), |
47 | 3.92k | GetPluginDescriptionStatic(), |
48 | 3.92k | lldb::eScriptLanguageNone, CreateInstance); |
49 | 3.92k | }); |
50 | 4.03k | } |
51 | | |
52 | 3.81k | void ScriptInterpreterNone::Terminate() {} |
53 | | |
54 | | lldb::ScriptInterpreterSP |
55 | 7 | ScriptInterpreterNone::CreateInstance(Debugger &debugger) { |
56 | 7 | return std::make_shared<ScriptInterpreterNone>(debugger); |
57 | 7 | } |
58 | | |
59 | 3.92k | llvm::StringRef ScriptInterpreterNone::GetPluginDescriptionStatic() { |
60 | 3.92k | return "Null script interpreter"; |
61 | 3.92k | } |