[lldb][NFC] Tablegenify alias/regex/history/source/script

(Converting these commands together as they are all simple commands
that share the same file).

llvm-svn: 366440
This commit is contained in:
Raphael Isemann 2019-07-18 14:10:49 +00:00
parent 6d3bb71c8f
commit 64becc11a8
2 changed files with 69 additions and 28 deletions

View File

@ -32,12 +32,8 @@ using namespace lldb_private;
// CommandObjectCommandsSource
static constexpr OptionDefinition g_history_options[] = {
// clang-format off
{ LLDB_OPT_SET_1, false, "count", 'c', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeUnsignedInteger, "How many history commands to print." },
{ LLDB_OPT_SET_1, false, "start-index", 's', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeUnsignedInteger, "Index at which to start printing history commands (or end to mean tail mode)." },
{ LLDB_OPT_SET_1, false, "end-index", 'e', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeUnsignedInteger, "Index at which to stop printing history commands." },
{ LLDB_OPT_SET_2, false, "clear", 'C', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeBoolean, "Clears the current command history." },
// clang-format on
#define LLDB_OPTIONS_history
#include "CommandOptions.inc"
};
class CommandObjectCommandsHistory : public CommandObjectParsed {
@ -189,11 +185,8 @@ protected:
// CommandObjectCommandsSource
static constexpr OptionDefinition g_source_options[] = {
// clang-format off
{ LLDB_OPT_SET_ALL, false, "stop-on-error", 'e', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeBoolean, "If true, stop executing commands on error." },
{ LLDB_OPT_SET_ALL, false, "stop-on-continue", 'c', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeBoolean, "If true, stop executing commands on continue." },
{ LLDB_OPT_SET_ALL, false, "silent-run", 's', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeBoolean, "If true don't echo commands while executing." },
// clang-format on
#define LLDB_OPTIONS_source
#include "CommandOptions.inc"
};
class CommandObjectCommandsSource : public CommandObjectParsed {
@ -344,10 +337,8 @@ protected:
// CommandObjectCommandsAlias
static constexpr OptionDefinition g_alias_options[] = {
// clang-format off
{ LLDB_OPT_SET_ALL, false, "help", 'h', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeHelpText, "Help text for this command" },
{ LLDB_OPT_SET_ALL, false, "long-help", 'H', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeHelpText, "Long help text for this command" },
// clang-format on
#define LLDB_OPTIONS_alias
#include "CommandOptions.inc"
};
static const char *g_python_command_instructions =
@ -912,10 +903,8 @@ protected:
// CommandObjectCommandsAddRegex
static constexpr OptionDefinition g_regex_options[] = {
// clang-format off
{ LLDB_OPT_SET_1, false, "help" , 'h', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeNone, "The help text to display for this command." },
{ LLDB_OPT_SET_1, false, "syntax", 's', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeNone, "A syntax string showing the typical usage syntax." },
// clang-format on
#define LLDB_OPTIONS_regex
#include "CommandOptions.inc"
};
#pragma mark CommandObjectCommandsAddRegex
@ -1387,9 +1376,8 @@ private:
// CommandObjectCommandsScriptImport
static constexpr OptionDefinition g_script_import_options[] = {
// clang-format off
{ LLDB_OPT_SET_1, false, "allow-reload", 'r', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Allow the script to be loaded even if it was already loaded before. This argument exists for backwards compatibility, but reloading is always allowed, whether you specify it or not." },
// clang-format on
#define LLDB_OPTIONS_script_import
#include "CommandOptions.inc"
};
class CommandObjectCommandsScriptImport : public CommandObjectParsed {
@ -1521,12 +1509,8 @@ static constexpr OptionEnumValues ScriptSynchroType() {
}
static constexpr OptionDefinition g_script_add_options[] = {
// clang-format off
{ LLDB_OPT_SET_1, false, "function", 'f', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypePythonFunction, "Name of the Python function to bind to this command name." },
{ LLDB_OPT_SET_2, false, "class", 'c', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypePythonClass, "Name of the Python class to bind to this command name." },
{ LLDB_OPT_SET_1, false, "help" , 'h', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeHelpText, "The help text to display for this command." },
{ LLDB_OPT_SET_ALL, false, "synchronicity", 's', OptionParser::eRequiredArgument, nullptr, ScriptSynchroType(), 0, eArgTypeScriptedCommandSynchronicity, "Set the synchronicity of this command's executions with regard to LLDB event system." },
// clang-format on
#define LLDB_OPTIONS_script_add
#include "CommandOptions.inc"
};
class CommandObjectCommandsScriptAdd : public CommandObjectParsed,

View File

@ -52,6 +52,63 @@ let Command = "breakpoint list" in {
"provided, which prime new targets.">;
}
let Command = "history" in {
def history_count : Option<"count", "c">, Group<1>, Arg<"UnsignedInteger">,
Desc<"How many history commands to print.">;
def history_start_index : Option<"start-index", "s">, Group<1>,
Arg<"UnsignedInteger">, Desc<"Index at which to start printing history "
"commands (or end to mean tail mode).">;
def history_end_index : Option<"end-index", "e">, Group<1>,
Arg<"UnsignedInteger">,
Desc<"Index at which to stop printing history commands.">;
def history_clear : Option<"clear", "C">, Group<2>,
Desc<"Clears the current command history.">;
}
let Command = "source" in {
def source_stop_on_error : Option<"stop-on-error", "e">, Arg<"Boolean">,
Desc<"If true, stop executing commands on error.">;
def source_stop_on_continue : Option<"stop-on-continue", "c">, Arg<"Boolean">,
Desc<"If true, stop executing commands on continue.">;
def source_silent_run : Option<"silent-run", "s">, Arg<"Boolean">,
Desc<"If true don't echo commands while executing.">;
}
let Command = "alias" in {
def alias_help : Option<"help", "h">, Arg<"HelpText">,
Desc<"Help text for this command">;
def alias_long_help : Option<"long-help", "H">, Arg<"HelpText">,
Desc<"Long help text for this command">;
}
let Command = "regex" in {
def regex_help : Option<"help", "h">, Group<1>, Arg<"None">,
Desc<"The help text to display for this command.">;
def regex_syntax : Option<"syntax", "s">, Group<1>, Arg<"None">,
Desc<"A syntax string showing the typical usage syntax.">;
}
let Command = "script import" in {
def script_import_allow_reload : Option<"allow-reload", "r">, Group<1>,
Desc<"Allow the script to be loaded even if it was already loaded before. "
"This argument exists for backwards compatibility, but reloading is always "
"allowed, whether you specify it or not.">;
}
let Command = "script add" in {
def script_add_function : Option<"function", "f">, Group<1>,
Arg<"PythonFunction">,
Desc<"Name of the Python function to bind to this command name.">;
def script_add_class : Option<"class", "c">, Group<2>, Arg<"PythonClass">,
Desc<"Name of the Python class to bind to this command name.">;
def script_add_help : Option<"help", "h">, Group<1>, Arg<"HelpText">,
Desc<"The help text to display for this command.">;
def script_add_synchronicity : Option<"synchronicity", "s">,
EnumArg<"ScriptedCommandSynchronicity", "ScriptSynchroType()">,
Desc<"Set the synchronicity of this command's executions with regard to "
"LLDB event system.">;
}
let Command = "thread backtrace" in {
def thread_backtrace_count : Option<"count", "c">, Group<1>, Arg<"Count">,
Desc<"How many frames to display (-1 for all)">;