Coverage Report

Created: 2022-01-22 13:19

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