2020-01-24 08:23:27 +01:00
|
|
|
//===-- ScriptInterpreterNone.cpp -----------------------------------------===//
|
2015-07-30 20:28:07 +00:00
|
|
|
//
|
2019-01-19 08:50:56 +00:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2015-07-30 20:28:07 +00:00
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
|
|
#include "ScriptInterpreterNone.h"
|
|
|
|
|
#include "lldb/Core/Debugger.h"
|
|
|
|
|
#include "lldb/Core/PluginManager.h"
|
|
|
|
|
#include "lldb/Core/StreamFile.h"
|
2017-02-02 21:39:50 +00:00
|
|
|
#include "lldb/Utility/Stream.h"
|
2017-03-21 18:25:04 +00:00
|
|
|
#include "lldb/Utility/StringList.h"
|
2015-07-30 20:28:07 +00:00
|
|
|
|
2017-02-06 17:55:02 +00:00
|
|
|
#include "llvm/Support/Threading.h"
|
|
|
|
|
|
2015-07-30 20:28:07 +00:00
|
|
|
#include <mutex>
|
|
|
|
|
|
|
|
|
|
using namespace lldb;
|
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
|
2020-02-14 09:46:02 -08:00
|
|
|
LLDB_PLUGIN_DEFINE(ScriptInterpreterNone)
|
2020-02-07 14:58:18 -08:00
|
|
|
|
2019-04-26 17:58:19 +00:00
|
|
|
ScriptInterpreterNone::ScriptInterpreterNone(Debugger &debugger)
|
|
|
|
|
: ScriptInterpreter(debugger, eScriptLanguageNone) {}
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2015-07-30 20:28:07 +00:00
|
|
|
ScriptInterpreterNone::~ScriptInterpreterNone() {}
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2018-07-12 22:28:52 +00:00
|
|
|
bool ScriptInterpreterNone::ExecuteOneLine(llvm::StringRef command,
|
2015-07-30 20:28:07 +00:00
|
|
|
CommandReturnObject *,
|
|
|
|
|
const ExecuteScriptOptions &) {
|
2019-09-27 14:33:35 +00:00
|
|
|
m_debugger.GetErrorStream().PutCString(
|
2015-07-30 20:28:07 +00:00
|
|
|
"error: there is no embedded script interpreter in this mode.\n");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScriptInterpreterNone::ExecuteInterpreterLoop() {
|
2019-09-27 14:33:35 +00:00
|
|
|
m_debugger.GetErrorStream().PutCString(
|
2015-07-30 20:28:07 +00:00
|
|
|
"error: there is no embedded script interpreter in this mode.\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScriptInterpreterNone::Initialize() {
|
2017-02-06 17:55:02 +00:00
|
|
|
static llvm::once_flag g_once_flag;
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2017-02-06 17:55:02 +00:00
|
|
|
llvm::call_once(g_once_flag, []() {
|
2015-07-30 20:28:07 +00:00
|
|
|
PluginManager::RegisterPlugin(GetPluginNameStatic(),
|
|
|
|
|
GetPluginDescriptionStatic(),
|
|
|
|
|
lldb::eScriptLanguageNone, CreateInstance);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScriptInterpreterNone::Terminate() {}
|
|
|
|
|
|
|
|
|
|
lldb::ScriptInterpreterSP
|
2019-04-26 17:58:19 +00:00
|
|
|
ScriptInterpreterNone::CreateInstance(Debugger &debugger) {
|
|
|
|
|
return std::make_shared<ScriptInterpreterNone>(debugger);
|
2015-07-30 20:28:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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; }
|