This moves the following classes from Core -> Utility. ConstString Error RegularExpression Stream StreamString The goal here is to get lldbUtility into a state where it has no dependendencies except on itself and LLVM, so it can be the starting point at which to start untangling LLDB's dependencies. These are all low level and very widely used classes, and previously lldbUtility had dependencies up to lldbCore in order to use these classes. So moving then down to lldbUtility makes sense from both the short term and long term perspective in solving this problem. Differential Revision: https://reviews.llvm.org/D29427 llvm-svn: 293941
72 lines
2.3 KiB
C++
72 lines
2.3 KiB
C++
//===-- 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/StreamFile.h"
|
|
#include "lldb/Core/StringList.h"
|
|
#include "lldb/Interpreter/CommandInterpreter.h"
|
|
#include "lldb/Utility/Stream.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; }
|