From e81d9d49145e432d917eea3a70d2ae74dcad1d89 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 30 Dec 2015 11:55:28 +0000 Subject: Vendor import of stripped lldb trunk r256633: https://llvm.org/svn/llvm-project/lldb/trunk@256633 --- .../None/ScriptInterpreterNone.cpp | 93 ++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp (limited to 'source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp') diff --git a/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp b/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp new file mode 100644 index 0000000000000..1a352fa1987fd --- /dev/null +++ b/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp @@ -0,0 +1,93 @@ +//===-- ScriptInterpreterNone.cpp -------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "ScriptInterpreterNone.h" +#include "lldb/Core/Debugger.h" +#include "lldb/Core/PluginManager.h" +#include "lldb/Core/Stream.h" +#include "lldb/Core/StreamFile.h" +#include "lldb/Core/StringList.h" +#include "lldb/Interpreter/CommandInterpreter.h" + +#include + +using namespace lldb; +using namespace lldb_private; + +ScriptInterpreterNone::ScriptInterpreterNone(CommandInterpreter &interpreter) + : ScriptInterpreter(interpreter, eScriptLanguageNone) +{ +} + +ScriptInterpreterNone::~ScriptInterpreterNone() +{ +} + +bool +ScriptInterpreterNone::ExecuteOneLine(const char *command, CommandReturnObject *, const ExecuteScriptOptions &) +{ + m_interpreter.GetDebugger().GetErrorFile()->PutCString( + "error: there is no embedded script interpreter in this mode.\n"); + return false; +} + +void +ScriptInterpreterNone::ExecuteInterpreterLoop() +{ + m_interpreter.GetDebugger().GetErrorFile()->PutCString( + "error: there is no embedded script interpreter in this mode.\n"); +} + +void +ScriptInterpreterNone::Initialize() +{ + static std::once_flag g_once_flag; + + std::call_once(g_once_flag, []() + { + PluginManager::RegisterPlugin(GetPluginNameStatic(), GetPluginDescriptionStatic(), + lldb::eScriptLanguageNone, CreateInstance); + }); +} + +void +ScriptInterpreterNone::Terminate() +{ +} + +lldb::ScriptInterpreterSP +ScriptInterpreterNone::CreateInstance(CommandInterpreter &interpreter) +{ + return std::make_shared(interpreter); +} + +lldb_private::ConstString +ScriptInterpreterNone::GetPluginNameStatic() +{ + static ConstString g_name("script-none"); + return g_name; +} + +const char * +ScriptInterpreterNone::GetPluginDescriptionStatic() +{ + return "Null script interpreter"; +} + +lldb_private::ConstString +ScriptInterpreterNone::GetPluginName() +{ + return GetPluginNameStatic(); +} + +uint32_t +ScriptInterpreterNone::GetPluginVersion() +{ + return 1; +} -- cgit v1.2.3