1 //===-- ScriptInterpreterNone.cpp -------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "ScriptInterpreterNone.h"
11 #include "lldb/Core/Debugger.h"
12 #include "lldb/Core/PluginManager.h"
13 #include "lldb/Core/StreamFile.h"
14 #include "lldb/Interpreter/CommandInterpreter.h"
15 #include "lldb/Utility/Stream.h"
16 #include "lldb/Utility/StringList.h"
18 #include "llvm/Support/Threading.h"
23 using namespace lldb_private;
25 ScriptInterpreterNone::ScriptInterpreterNone(CommandInterpreter &interpreter)
26 : ScriptInterpreter(interpreter, eScriptLanguageNone) {}
28 ScriptInterpreterNone::~ScriptInterpreterNone() {}
30 bool ScriptInterpreterNone::ExecuteOneLine(llvm::StringRef command,
31 CommandReturnObject *,
32 const ExecuteScriptOptions &) {
33 m_interpreter.GetDebugger().GetErrorFile()->PutCString(
34 "error: there is no embedded script interpreter in this mode.\n");
38 void ScriptInterpreterNone::ExecuteInterpreterLoop() {
39 m_interpreter.GetDebugger().GetErrorFile()->PutCString(
40 "error: there is no embedded script interpreter in this mode.\n");
43 void ScriptInterpreterNone::Initialize() {
44 static llvm::once_flag g_once_flag;
46 llvm::call_once(g_once_flag, []() {
47 PluginManager::RegisterPlugin(GetPluginNameStatic(),
48 GetPluginDescriptionStatic(),
49 lldb::eScriptLanguageNone, CreateInstance);
53 void ScriptInterpreterNone::Terminate() {}
55 lldb::ScriptInterpreterSP
56 ScriptInterpreterNone::CreateInstance(CommandInterpreter &interpreter) {
57 return std::make_shared<ScriptInterpreterNone>(interpreter);
60 lldb_private::ConstString ScriptInterpreterNone::GetPluginNameStatic() {
61 static ConstString g_name("script-none");
65 const char *ScriptInterpreterNone::GetPluginDescriptionStatic() {
66 return "Null script interpreter";
69 lldb_private::ConstString ScriptInterpreterNone::GetPluginName() {
70 return GetPluginNameStatic();
73 uint32_t ScriptInterpreterNone::GetPluginVersion() { return 1; }