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/Stream.h"
14 #include "lldb/Core/StreamFile.h"
15 #include "lldb/Core/StringList.h"
16 #include "lldb/Interpreter/CommandInterpreter.h"
21 using namespace lldb_private;
23 ScriptInterpreterNone::ScriptInterpreterNone(CommandInterpreter &interpreter)
24 : ScriptInterpreter(interpreter, eScriptLanguageNone) {}
26 ScriptInterpreterNone::~ScriptInterpreterNone() {}
28 bool ScriptInterpreterNone::ExecuteOneLine(const char *command,
29 CommandReturnObject *,
30 const ExecuteScriptOptions &) {
31 m_interpreter.GetDebugger().GetErrorFile()->PutCString(
32 "error: there is no embedded script interpreter in this mode.\n");
36 void ScriptInterpreterNone::ExecuteInterpreterLoop() {
37 m_interpreter.GetDebugger().GetErrorFile()->PutCString(
38 "error: there is no embedded script interpreter in this mode.\n");
41 void ScriptInterpreterNone::Initialize() {
42 static std::once_flag g_once_flag;
44 std::call_once(g_once_flag, []() {
45 PluginManager::RegisterPlugin(GetPluginNameStatic(),
46 GetPluginDescriptionStatic(),
47 lldb::eScriptLanguageNone, CreateInstance);
51 void ScriptInterpreterNone::Terminate() {}
53 lldb::ScriptInterpreterSP
54 ScriptInterpreterNone::CreateInstance(CommandInterpreter &interpreter) {
55 return std::make_shared<ScriptInterpreterNone>(interpreter);
58 lldb_private::ConstString ScriptInterpreterNone::GetPluginNameStatic() {
59 static ConstString g_name("script-none");
63 const char *ScriptInterpreterNone::GetPluginDescriptionStatic() {
64 return "Null script interpreter";
67 lldb_private::ConstString ScriptInterpreterNone::GetPluginName() {
68 return GetPluginNameStatic();
71 uint32_t ScriptInterpreterNone::GetPluginVersion() { return 1; }