aboutsummaryrefslogtreecommitdiffstats
path: root/source/Plugins/ScriptInterpreter/None
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-12-30 11:55:28 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-12-30 11:55:28 +0000
commite81d9d49145e432d917eea3a70d2ae74dcad1d89 (patch)
tree9ed5e1a91f242e2cb5911577356e487a55c01b78 /source/Plugins/ScriptInterpreter/None
parent85d8ef8f1f0e0e063a8571944302be2d2026f823 (diff)
downloadsrc-e81d9d49145e432d917eea3a70d2ae74dcad1d89.tar.gz
src-e81d9d49145e432d917eea3a70d2ae74dcad1d89.zip
Vendor import of stripped lldb trunk r256633:
Notes
Notes: svn path=/vendor/lldb/dist/; revision=292932
Diffstat (limited to 'source/Plugins/ScriptInterpreter/None')
-rw-r--r--source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp93
-rw-r--r--source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h66
2 files changed, 159 insertions, 0 deletions
diff --git a/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp b/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp
new file mode 100644
index 000000000000..1a352fa1987f
--- /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 <mutex>
+
+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<ScriptInterpreterNone>(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;
+}
diff --git a/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h b/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h
new file mode 100644
index 000000000000..49fd4fabfbc5
--- /dev/null
+++ b/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h
@@ -0,0 +1,66 @@
+//===-- ScriptInterpreterNone.h ---------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_ScriptInterpreterNone_h_
+#define liblldb_ScriptInterpreterNone_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Interpreter/ScriptInterpreter.h"
+
+namespace lldb_private
+{
+
+class ScriptInterpreterNone : public ScriptInterpreter
+{
+ public:
+ ScriptInterpreterNone(CommandInterpreter &interpreter);
+
+ ~ScriptInterpreterNone() override;
+
+ bool
+ ExecuteOneLine(const char *command, CommandReturnObject *result,
+ const ExecuteScriptOptions &options = ExecuteScriptOptions()) override;
+
+ void
+ ExecuteInterpreterLoop() override;
+
+ //------------------------------------------------------------------
+ // Static Functions
+ //------------------------------------------------------------------
+ static void
+ Initialize();
+
+ static void
+ Terminate();
+
+ static lldb::ScriptInterpreterSP
+ CreateInstance(CommandInterpreter &interpreter);
+
+ static lldb_private::ConstString
+ GetPluginNameStatic();
+
+ static const char *
+ GetPluginDescriptionStatic();
+
+ //------------------------------------------------------------------
+ // PluginInterface protocol
+ //------------------------------------------------------------------
+ lldb_private::ConstString
+ GetPluginName() override;
+
+ uint32_t
+ GetPluginVersion() override;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_ScriptInterpreterNone_h_