12#include "lldb/Host/Config.h"
24#define LLDB_OPTIONS_script
25#include "CommandOptions.inc"
28 uint32_t option_idx, llvm::StringRef option_arg,
33 switch (short_option) {
39 error.SetErrorStringWithFormat(
"unrecognized value for language '%s'",
40 option_arg.str().c_str());
43 llvm_unreachable(
"Unimplemented option");
54llvm::ArrayRef<OptionDefinition>
56 return llvm::ArrayRef(g_script_options);
61 interpreter,
"script",
62 "Invoke the script interpreter with provided code and display any "
63 "results. Start the interactive interpreter if no code is supplied.",
64 "script [--language <scripting-language> --] [<script-code>]") {}
86 "the script-lang setting is set to none - scripting not available");
93 if (script_interpreter ==
nullptr) {
102 if (command.empty()) {
static llvm::raw_ostream & error(Stream &strm)
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
void OptionParsingStarting(ExecutionContext *execution_context) override
lldb::ScriptLanguage language
bool DoExecute(llvm::StringRef command, CommandReturnObject &result) override
~CommandObjectScript() override
CommandObjectScript(CommandInterpreter &interpreter)
CommandInterpreter & m_interpreter
bool ParseOptions(Args &args, CommandReturnObject &result)
void void AppendError(llvm::StringRef in_string)
void SetStatus(lldb::ReturnStatus status)
static void ForceUpdate()
lldb::ScriptLanguage GetScriptLanguage() const
ScriptInterpreter * GetScriptInterpreter(bool can_create=true, std::optional< lldb::ScriptLanguage > language={})
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A pair of an option list with a 'raw' string as a suffix.
bool HasArgs() const
Returns true if there are any arguments before the raw suffix.
Args & GetArgs()
Returns the list of arguments.
const std::string & GetRawPart() const
Returns the raw suffix part of the parsed string.
std::vector< Option > m_getopt_table
virtual void ExecuteInterpreterLoop()=0
virtual bool ExecuteOneLine(llvm::StringRef command, CommandReturnObject *result, const ExecuteScriptOptions &options=ExecuteScriptOptions())=0
A class that represents a running process on the host machine.
ScriptLanguage
Script interpreter types.
@ eReturnStatusSuccessFinishNoResult
static int64_t ToOptionEnum(llvm::StringRef s, const OptionEnumValues &enum_values, int32_t fail_value, Status &error)