diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2022-07-13 20:11:37 -0700 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2022-07-14 21:18:07 -0700 |
commit | 7ced9fff95473c1794b51a3cfd099b4fea3d1a58 (patch) | |
tree | 327c5419e195d917e3a127edc8f5d0c725455fd3 /lldb/source/Interpreter/CommandObject.cpp | |
parent | 888673b6e3bf0182fb5f154eb3231c9ae022acca (diff) | |
download | llvm-7ced9fff95473c1794b51a3cfd099b4fea3d1a58.zip llvm-7ced9fff95473c1794b51a3cfd099b4fea3d1a58.tar.gz llvm-7ced9fff95473c1794b51a3cfd099b4fea3d1a58.tar.bz2 |
[lldb] Refactor command option enum values (NFC)
Refactor the command option enum values and the command argument table
to connect the two. This has two benefits:
- We guarantee that two options that use the same argument type have
the same accepted values.
- We can print the enum values and their description in the help
output. (D129707)
Differential revision: https://reviews.llvm.org/D129703
Diffstat (limited to 'lldb/source/Interpreter/CommandObject.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandObject.cpp | 416 |
1 files changed, 9 insertions, 407 deletions
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index 910d740..609ac57 100644 --- a/lldb/source/Interpreter/CommandObject.cpp +++ b/lldb/source/Interpreter/CommandObject.cpp @@ -31,6 +31,7 @@ #include "lldb/Target/Language.h" #include "lldb/Interpreter/CommandInterpreter.h" +#include "lldb/Interpreter/CommandOptionArgumentTable.h" #include "lldb/Interpreter/CommandReturnObject.h" using namespace lldb; @@ -365,19 +366,16 @@ CommandObject::GetArgumentEntryAtIndex(int idx) { const CommandObject::ArgumentTableEntry * CommandObject::FindArgumentDataByType(CommandArgumentType arg_type) { - const ArgumentTableEntry *table = CommandObject::GetArgumentTable(); - for (int i = 0; i < eArgTypeLastArg; ++i) - if (table[i].arg_type == arg_type) - return &(table[i]); + if (g_argument_table[i].arg_type == arg_type) + return &(g_argument_table[i]); return nullptr; } void CommandObject::GetArgumentHelp(Stream &str, CommandArgumentType arg_type, CommandInterpreter &interpreter) { - const ArgumentTableEntry *table = CommandObject::GetArgumentTable(); - const ArgumentTableEntry *entry = &(table[arg_type]); + const ArgumentTableEntry *entry = &(g_argument_table[arg_type]); // The table is *supposed* to be kept in arg_type order, but someone *could* // have messed it up... @@ -406,8 +404,7 @@ void CommandObject::GetArgumentHelp(Stream &str, CommandArgumentType arg_type, } const char *CommandObject::GetArgumentName(CommandArgumentType arg_type) { - const ArgumentTableEntry *entry = - &(CommandObject::GetArgumentTable()[arg_type]); + const ArgumentTableEntry *entry = &(g_argument_table[arg_type]); // The table is *supposed* to be kept in arg_type order, but someone *could* // have messed it up... @@ -544,287 +541,13 @@ CommandObject::LookupArgumentName(llvm::StringRef arg_name) { arg_name = arg_name.ltrim('<').rtrim('>'); - const ArgumentTableEntry *table = GetArgumentTable(); for (int i = 0; i < eArgTypeLastArg; ++i) - if (arg_name == table[i].arg_name) - return_type = GetArgumentTable()[i].arg_type; + if (arg_name == g_argument_table[i].arg_name) + return_type = g_argument_table[i].arg_type; return return_type; } -static llvm::StringRef RegisterNameHelpTextCallback() { - return "Register names can be specified using the architecture specific " - "names. " - "They can also be specified using generic names. Not all generic " - "entities have " - "registers backing them on all architectures. When they don't the " - "generic name " - "will return an error.\n" - "The generic names defined in lldb are:\n" - "\n" - "pc - program counter register\n" - "ra - return address register\n" - "fp - frame pointer register\n" - "sp - stack pointer register\n" - "flags - the flags register\n" - "arg{1-6} - integer argument passing registers.\n"; -} - -static llvm::StringRef BreakpointIDHelpTextCallback() { - return "Breakpoints are identified using major and minor numbers; the major " - "number corresponds to the single entity that was created with a " - "'breakpoint " - "set' command; the minor numbers correspond to all the locations that " - "were " - "actually found/set based on the major breakpoint. A full breakpoint " - "ID might " - "look like 3.14, meaning the 14th location set for the 3rd " - "breakpoint. You " - "can specify all the locations of a breakpoint by just indicating the " - "major " - "breakpoint number. A valid breakpoint ID consists either of just the " - "major " - "number, or the major number followed by a dot and the location " - "number (e.g. " - "3 or 3.2 could both be valid breakpoint IDs.)"; -} - -static llvm::StringRef BreakpointIDRangeHelpTextCallback() { - return "A 'breakpoint ID list' is a manner of specifying multiple " - "breakpoints. " - "This can be done through several mechanisms. The easiest way is to " - "just " - "enter a space-separated list of breakpoint IDs. To specify all the " - "breakpoint locations under a major breakpoint, you can use the major " - "breakpoint number followed by '.*', eg. '5.*' means all the " - "locations under " - "breakpoint 5. You can also indicate a range of breakpoints by using " - "<start-bp-id> - <end-bp-id>. The start-bp-id and end-bp-id for a " - "range can " - "be any valid breakpoint IDs. It is not legal, however, to specify a " - "range " - "using specific locations that cross major breakpoint numbers. I.e. " - "3.2 - 3.7" - " is legal; 2 - 5 is legal; but 3.2 - 4.4 is not legal."; -} - -static llvm::StringRef BreakpointNameHelpTextCallback() { - return "A name that can be added to a breakpoint when it is created, or " - "later " - "on with the \"breakpoint name add\" command. " - "Breakpoint names can be used to specify breakpoints in all the " - "places breakpoint IDs " - "and breakpoint ID ranges can be used. As such they provide a " - "convenient way to group breakpoints, " - "and to operate on breakpoints you create without having to track the " - "breakpoint number. " - "Note, the attributes you set when using a breakpoint name in a " - "breakpoint command don't " - "adhere to the name, but instead are set individually on all the " - "breakpoints currently tagged with that " - "name. Future breakpoints " - "tagged with that name will not pick up the attributes previously " - "given using that name. " - "In order to distinguish breakpoint names from breakpoint IDs and " - "ranges, " - "names must start with a letter from a-z or A-Z and cannot contain " - "spaces, \".\" or \"-\". " - "Also, breakpoint names can only be applied to breakpoints, not to " - "breakpoint locations."; -} - -static llvm::StringRef GDBFormatHelpTextCallback() { - return "A GDB format consists of a repeat count, a format letter and a size " - "letter. " - "The repeat count is optional and defaults to 1. The format letter is " - "optional " - "and defaults to the previous format that was used. The size letter " - "is optional " - "and defaults to the previous size that was used.\n" - "\n" - "Format letters include:\n" - "o - octal\n" - "x - hexadecimal\n" - "d - decimal\n" - "u - unsigned decimal\n" - "t - binary\n" - "f - float\n" - "a - address\n" - "i - instruction\n" - "c - char\n" - "s - string\n" - "T - OSType\n" - "A - float as hex\n" - "\n" - "Size letters include:\n" - "b - 1 byte (byte)\n" - "h - 2 bytes (halfword)\n" - "w - 4 bytes (word)\n" - "g - 8 bytes (giant)\n" - "\n" - "Example formats:\n" - "32xb - show 32 1 byte hexadecimal integer values\n" - "16xh - show 16 2 byte hexadecimal integer values\n" - "64 - show 64 2 byte hexadecimal integer values (format and size " - "from the last format)\n" - "dw - show 1 4 byte decimal integer value\n"; -} - -static llvm::StringRef FormatHelpTextCallback() { - static std::string help_text; - - if (!help_text.empty()) - return help_text; - - StreamString sstr; - sstr << "One of the format names (or one-character names) that can be used " - "to show a variable's value:\n"; - for (Format f = eFormatDefault; f < kNumFormats; f = Format(f + 1)) { - if (f != eFormatDefault) - sstr.PutChar('\n'); - - char format_char = FormatManager::GetFormatAsFormatChar(f); - if (format_char) - sstr.Printf("'%c' or ", format_char); - - sstr.Printf("\"%s\"", FormatManager::GetFormatAsCString(f)); - } - - sstr.Flush(); - - help_text = std::string(sstr.GetString()); - - return help_text; -} - -static llvm::StringRef LanguageTypeHelpTextCallback() { - static std::string help_text; - - if (!help_text.empty()) - return help_text; - - StreamString sstr; - sstr << "One of the following languages:\n"; - - Language::PrintAllLanguages(sstr, " ", "\n"); - - sstr.Flush(); - - help_text = std::string(sstr.GetString()); - - return help_text; -} - -static llvm::StringRef SummaryStringHelpTextCallback() { - return "A summary string is a way to extract information from variables in " - "order to present them using a summary.\n" - "Summary strings contain static text, variables, scopes and control " - "sequences:\n" - " - Static text can be any sequence of non-special characters, i.e. " - "anything but '{', '}', '$', or '\\'.\n" - " - Variables are sequences of characters beginning with ${, ending " - "with } and that contain symbols in the format described below.\n" - " - Scopes are any sequence of text between { and }. Anything " - "included in a scope will only appear in the output summary if there " - "were no errors.\n" - " - Control sequences are the usual C/C++ '\\a', '\\n', ..., plus " - "'\\$', '\\{' and '\\}'.\n" - "A summary string works by copying static text verbatim, turning " - "control sequences into their character counterpart, expanding " - "variables and trying to expand scopes.\n" - "A variable is expanded by giving it a value other than its textual " - "representation, and the way this is done depends on what comes after " - "the ${ marker.\n" - "The most common sequence if ${var followed by an expression path, " - "which is the text one would type to access a member of an aggregate " - "types, given a variable of that type" - " (e.g. if type T has a member named x, which has a member named y, " - "and if t is of type T, the expression path would be .x.y and the way " - "to fit that into a summary string would be" - " ${var.x.y}). You can also use ${*var followed by an expression path " - "and in that case the object referred by the path will be " - "dereferenced before being displayed." - " If the object is not a pointer, doing so will cause an error. For " - "additional details on expression paths, you can type 'help " - "expr-path'. \n" - "By default, summary strings attempt to display the summary for any " - "variable they reference, and if that fails the value. If neither can " - "be shown, nothing is displayed." - "In a summary string, you can also use an array index [n], or a " - "slice-like range [n-m]. This can have two different meanings " - "depending on what kind of object the expression" - " path refers to:\n" - " - if it is a scalar type (any basic type like int, float, ...) the " - "expression is a bitfield, i.e. the bits indicated by the indexing " - "operator are extracted out of the number" - " and displayed as an individual variable\n" - " - if it is an array or pointer the array items indicated by the " - "indexing operator are shown as the result of the variable. if the " - "expression is an array, real array items are" - " printed; if it is a pointer, the pointer-as-array syntax is used to " - "obtain the values (this means, the latter case can have no range " - "checking)\n" - "If you are trying to display an array for which the size is known, " - "you can also use [] instead of giving an exact range. This has the " - "effect of showing items 0 thru size - 1.\n" - "Additionally, a variable can contain an (optional) format code, as " - "in ${var.x.y%code}, where code can be any of the valid formats " - "described in 'help format', or one of the" - " special symbols only allowed as part of a variable:\n" - " %V: show the value of the object by default\n" - " %S: show the summary of the object by default\n" - " %@: show the runtime-provided object description (for " - "Objective-C, it calls NSPrintForDebugger; for C/C++ it does " - "nothing)\n" - " %L: show the location of the object (memory address or a " - "register name)\n" - " %#: show the number of children of the object\n" - " %T: show the type of the object\n" - "Another variable that you can use in summary strings is ${svar . " - "This sequence works exactly like ${var, including the fact that " - "${*svar is an allowed sequence, but uses" - " the object's synthetic children provider instead of the actual " - "objects. For instance, if you are using STL synthetic children " - "providers, the following summary string would" - " count the number of actual elements stored in an std::list:\n" - "type summary add -s \"${svar%#}\" -x \"std::list<\""; -} - -static llvm::StringRef ExprPathHelpTextCallback() { - return "An expression path is the sequence of symbols that is used in C/C++ " - "to access a member variable of an aggregate object (class).\n" - "For instance, given a class:\n" - " class foo {\n" - " int a;\n" - " int b; .\n" - " foo* next;\n" - " };\n" - "the expression to read item b in the item pointed to by next for foo " - "aFoo would be aFoo.next->b.\n" - "Given that aFoo could just be any object of type foo, the string " - "'.next->b' is the expression path, because it can be attached to any " - "foo instance to achieve the effect.\n" - "Expression paths in LLDB include dot (.) and arrow (->) operators, " - "and most commands using expression paths have ways to also accept " - "the star (*) operator.\n" - "The meaning of these operators is the same as the usual one given to " - "them by the C/C++ standards.\n" - "LLDB also has support for indexing ([ ]) in expression paths, and " - "extends the traditional meaning of the square brackets operator to " - "allow bitfield extraction:\n" - "for objects of native types (int, float, char, ...) saying '[n-m]' " - "as an expression path (where n and m are any positive integers, e.g. " - "[3-5]) causes LLDB to extract" - " bits n thru m from the value of the variable. If n == m, [n] is " - "also allowed as a shortcut syntax. For arrays and pointers, " - "expression paths can only contain one index" - " and the meaning of the operation is the same as the one defined by " - "C/C++ (item extraction). Some commands extend bitfield-like syntax " - "for arrays and pointers with the" - " meaning of array slicing (taking elements n thru m inside the array " - "or pointed-to memory)."; -} - void CommandObject::FormatLongHelpText(Stream &output_strm, llvm::StringRef long_help) { CommandInterpreter &interpreter = GetCommandInterpreter(); @@ -924,14 +647,14 @@ const char *CommandObject::GetArgumentTypeAsCString( const lldb::CommandArgumentType arg_type) { assert(arg_type < eArgTypeLastArg && "Invalid argument type passed to GetArgumentTypeAsCString"); - return GetArgumentTable()[arg_type].arg_name; + return g_argument_table[arg_type].arg_name; } const char *CommandObject::GetArgumentDescriptionAsCString( const lldb::CommandArgumentType arg_type) { assert(arg_type < eArgTypeLastArg && "Invalid argument type passed to GetArgumentDescriptionAsCString"); - return GetArgumentTable()[arg_type].help_text; + return g_argument_table[arg_type].help_text; } Target &CommandObject::GetDummyTarget() { @@ -1028,124 +751,3 @@ bool CommandObjectRaw::Execute(const char *args_string, } return handled; } - -static llvm::StringRef arch_helper() { - static StreamString g_archs_help; - if (g_archs_help.Empty()) { - StringList archs; - - ArchSpec::ListSupportedArchNames(archs); - g_archs_help.Printf("These are the supported architecture names:\n"); - archs.Join("\n", g_archs_help); - } - return g_archs_help.GetString(); -} - -static constexpr CommandObject::ArgumentTableEntry g_arguments_data[] = { - // clang-format off - { eArgTypeAddress, "address", CommandCompletions::eNoCompletion, { nullptr, false }, "A valid address in the target program's execution space." }, - { eArgTypeAddressOrExpression, "address-expression", CommandCompletions::eNoCompletion, { nullptr, false }, "An expression that resolves to an address." }, - { eArgTypeAliasName, "alias-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of an abbreviation (alias) for a debugger command." }, - { eArgTypeAliasOptions, "options-for-aliased-command", CommandCompletions::eNoCompletion, { nullptr, false }, "Command options to be used as part of an alias (abbreviation) definition. (See 'help commands alias' for more information.)" }, - { eArgTypeArchitecture, "arch", CommandCompletions::eArchitectureCompletion, { arch_helper, true }, "The architecture name, e.g. i386 or x86_64." }, - { eArgTypeBoolean, "boolean", CommandCompletions::eNoCompletion, { nullptr, false }, "A Boolean value: 'true' or 'false'" }, - { eArgTypeBreakpointID, "breakpt-id", CommandCompletions::eNoCompletion, { BreakpointIDHelpTextCallback, false }, nullptr }, - { eArgTypeBreakpointIDRange, "breakpt-id-list", CommandCompletions::eNoCompletion, { BreakpointIDRangeHelpTextCallback, false }, nullptr }, - { eArgTypeBreakpointName, "breakpoint-name", CommandCompletions::eBreakpointNameCompletion, { BreakpointNameHelpTextCallback, false }, nullptr }, - { eArgTypeByteSize, "byte-size", CommandCompletions::eNoCompletion, { nullptr, false }, "Number of bytes to use." }, - { eArgTypeClassName, "class-name", CommandCompletions::eNoCompletion, { nullptr, false }, "Then name of a class from the debug information in the program." }, - { eArgTypeCommandName, "cmd-name", CommandCompletions::eNoCompletion, { nullptr, false }, "A debugger command (may be multiple words), without any options or arguments." }, - { eArgTypeCount, "count", CommandCompletions::eNoCompletion, { nullptr, false }, "An unsigned integer." }, - { eArgTypeDirectoryName, "directory", CommandCompletions::eDiskDirectoryCompletion, { nullptr, false }, "A directory name." }, - { eArgTypeDisassemblyFlavor, "disassembly-flavor", CommandCompletions::eDisassemblyFlavorCompletion, { nullptr, false }, "A disassembly flavor recognized by your disassembly plugin. Currently the only valid options are \"att\" and \"intel\" for Intel targets" }, - { eArgTypeDescriptionVerbosity, "description-verbosity", CommandCompletions::eNoCompletion, { nullptr, false }, "How verbose the output of 'po' should be." }, - { eArgTypeEndAddress, "end-address", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, - { eArgTypeExpression, "expr", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, - { eArgTypeExpressionPath, "expr-path", CommandCompletions::eNoCompletion, { ExprPathHelpTextCallback, true }, nullptr }, - { eArgTypeExprFormat, "expression-format", CommandCompletions::eNoCompletion, { nullptr, false }, "[ [bool|b] | [bin] | [char|c] | [oct|o] | [dec|i|d|u] | [hex|x] | [float|f] | [cstr|s] ]" }, - { eArgTypeFilename, "filename", CommandCompletions::eDiskFileCompletion, { nullptr, false }, "The name of a file (can include path)." }, - { eArgTypeFormat, "format", CommandCompletions::eNoCompletion, { FormatHelpTextCallback, true }, nullptr }, - { eArgTypeFrameIndex, "frame-index", CommandCompletions::eFrameIndexCompletion, { nullptr, false }, "Index into a thread's list of frames." }, - { eArgTypeFullName, "fullname", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, - { eArgTypeFunctionName, "function-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a function." }, - { eArgTypeFunctionOrSymbol, "function-or-symbol", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a function or symbol." }, - { eArgTypeGDBFormat, "gdb-format", CommandCompletions::eNoCompletion, { GDBFormatHelpTextCallback, true }, nullptr }, - { eArgTypeHelpText, "help-text", CommandCompletions::eNoCompletion, { nullptr, false }, "Text to be used as help for some other entity in LLDB" }, - { eArgTypeIndex, "index", CommandCompletions::eNoCompletion, { nullptr, false }, "An index into a list." }, - { eArgTypeLanguage, "source-language", CommandCompletions::eTypeLanguageCompletion, { LanguageTypeHelpTextCallback, true }, nullptr }, - { eArgTypeLineNum, "linenum", CommandCompletions::eNoCompletion, { nullptr, false }, "Line number in a source file." }, - { eArgTypeFileLineColumn, "linespec", CommandCompletions::eNoCompletion, { nullptr, false }, "A source specifier in the form file:line[:column]" }, - { eArgTypeLogCategory, "log-category", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a category within a log channel, e.g. all (try \"log list\" to see a list of all channels and their categories." }, - { eArgTypeLogChannel, "log-channel", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a log channel, e.g. process.gdb-remote (try \"log list\" to see a list of all channels and their categories)." }, - { eArgTypeMethod, "method", CommandCompletions::eNoCompletion, { nullptr, false }, "A C++ method name." }, - { eArgTypeName, "name", CommandCompletions::eTypeCategoryNameCompletion, { nullptr, false }, "Help text goes here." }, - { eArgTypeNewPathPrefix, "new-path-prefix", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, - { eArgTypeNumLines, "num-lines", CommandCompletions::eNoCompletion, { nullptr, false }, "The number of lines to use." }, - { eArgTypeNumberPerLine, "number-per-line", CommandCompletions::eNoCompletion, { nullptr, false }, "The number of items per line to display." }, - { eArgTypeOffset, "offset", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, - { eArgTypeOldPathPrefix, "old-path-prefix", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, - { eArgTypeOneLiner, "one-line-command", CommandCompletions::eNoCompletion, { nullptr, false }, "A command that is entered as a single line of text." }, - { eArgTypePath, "path", CommandCompletions::eDiskFileCompletion, { nullptr, false }, "Path." }, - { eArgTypePermissionsNumber, "perms-numeric", CommandCompletions::eNoCompletion, { nullptr, false }, "Permissions given as an octal number (e.g. 755)." }, - { eArgTypePermissionsString, "perms=string", CommandCompletions::eNoCompletion, { nullptr, false }, "Permissions given as a string value (e.g. rw-r-xr--)." }, - { eArgTypePid, "pid", CommandCompletions::eProcessIDCompletion, { nullptr, false }, "The process ID number." }, - { eArgTypePlugin, "plugin", CommandCompletions::eProcessPluginCompletion, { nullptr, false }, "Help text goes here." }, - { eArgTypeProcessName, "process-name", CommandCompletions::eProcessNameCompletion, { nullptr, false }, "The name of the process." }, - { eArgTypePythonClass, "python-class", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a Python class." }, - { eArgTypePythonFunction, "python-function", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a Python function." }, - { eArgTypePythonScript, "python-script", CommandCompletions::eNoCompletion, { nullptr, false }, "Source code written in Python." }, - { eArgTypeQueueName, "queue-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of the thread queue." }, - { eArgTypeRegisterName, "register-name", CommandCompletions::eNoCompletion, { RegisterNameHelpTextCallback, true }, nullptr }, - { eArgTypeRegularExpression, "regular-expression", CommandCompletions::eNoCompletion, { nullptr, false }, "A POSIX-compliant extended regular expression." }, - { eArgTypeRunArgs, "run-args", CommandCompletions::eNoCompletion, { nullptr, false }, "Arguments to be passed to the target program when it starts executing." }, - { eArgTypeRunMode, "run-mode", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, - { eArgTypeScriptedCommandSynchronicity, "script-cmd-synchronicity", CommandCompletions::eNoCompletion, { nullptr, false }, "The synchronicity to use to run scripted commands with regard to LLDB event system." }, - { eArgTypeScriptLang, "script-language", CommandCompletions::eNoCompletion, { nullptr, false }, "The scripting language to be used for script-based commands. Supported languages are python and lua." }, - { eArgTypeSearchWord, "search-word", CommandCompletions::eNoCompletion, { nullptr, false }, "Any word of interest for search purposes." }, - { eArgTypeSelector, "selector", CommandCompletions::eNoCompletion, { nullptr, false }, "An Objective-C selector name." }, - { eArgTypeSettingIndex, "setting-index", CommandCompletions::eNoCompletion, { nullptr, false }, "An index into a settings variable that is an array (try 'settings list' to see all the possible settings variables and their types)." }, - { eArgTypeSettingKey, "setting-key", CommandCompletions::eNoCompletion, { nullptr, false }, "A key into a settings variables that is a dictionary (try 'settings list' to see all the possible settings variables and their types)." }, - { eArgTypeSettingPrefix, "setting-prefix", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a settable internal debugger variable up to a dot ('.'), e.g. 'target.process.'" }, - { eArgTypeSettingVariableName, "setting-variable-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a settable internal debugger variable. Type 'settings list' to see a complete list of such variables." }, - { eArgTypeShlibName, "shlib-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a shared library." }, - { eArgTypeSourceFile, "source-file", CommandCompletions::eSourceFileCompletion, { nullptr, false }, "The name of a source file.." }, - { eArgTypeSortOrder, "sort-order", CommandCompletions::eNoCompletion, { nullptr, false }, "Specify a sort order when dumping lists." }, - { eArgTypeStartAddress, "start-address", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, - { eArgTypeSummaryString, "summary-string", CommandCompletions::eNoCompletion, { SummaryStringHelpTextCallback, true }, nullptr }, - { eArgTypeSymbol, "symbol", CommandCompletions::eSymbolCompletion, { nullptr, false }, "Any symbol name (function name, variable, argument, etc.)" }, - { eArgTypeThreadID, "thread-id", CommandCompletions::eNoCompletion, { nullptr, false }, "Thread ID number." }, - { eArgTypeThreadIndex, "thread-index", CommandCompletions::eNoCompletion, { nullptr, false }, "Index into the process' list of threads." }, - { eArgTypeThreadName, "thread-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The thread's name." }, - { eArgTypeTypeName, "type-name", CommandCompletions::eNoCompletion, { nullptr, false }, "A type name." }, - { eArgTypeUnsignedInteger, "unsigned-integer", CommandCompletions::eNoCompletion, { nullptr, false }, "An unsigned integer." }, - { eArgTypeUnixSignal, "unix-signal", CommandCompletions::eNoCompletion, { nullptr, false }, "A valid Unix signal name or number (e.g. SIGKILL, KILL or 9)." }, - { eArgTypeVarName, "variable-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a variable in your program." }, - { eArgTypeValue, "value", CommandCompletions::eNoCompletion, { nullptr, false }, "A value could be anything, depending on where and how it is used." }, - { eArgTypeWidth, "width", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, - { eArgTypeNone, "none", CommandCompletions::eNoCompletion, { nullptr, false }, "No help available for this." }, - { eArgTypePlatform, "platform-name", CommandCompletions::ePlatformPluginCompletion, { nullptr, false }, "The name of an installed platform plug-in . Type 'platform list' to see a complete list of installed platforms." }, - { eArgTypeWatchpointID, "watchpt-id", CommandCompletions::eNoCompletion, { nullptr, false }, "Watchpoint IDs are positive integers." }, - { eArgTypeWatchpointIDRange, "watchpt-id-list", CommandCompletions::eNoCompletion, { nullptr, false }, "For example, '1-3' or '1 to 3'." }, - { eArgTypeWatchType, "watch-type", CommandCompletions::eNoCompletion, { nullptr, false }, "Specify the type for a watchpoint." }, - { eArgRawInput, "raw-input", CommandCompletions::eNoCompletion, { nullptr, false }, "Free-form text passed to a command without prior interpretation, allowing spaces without requiring quotes. To pass arguments and free form text put two dashes ' -- ' between the last argument and any raw input." }, - { eArgTypeCommand, "command", CommandCompletions::eNoCompletion, { nullptr, false }, "An LLDB Command line command element." }, - { eArgTypeColumnNum, "column", CommandCompletions::eNoCompletion, { nullptr, false }, "Column number in a source file." }, - { eArgTypeModuleUUID, "module-uuid", CommandCompletions::eModuleUUIDCompletion, { nullptr, false }, "A module UUID value." }, - { eArgTypeSaveCoreStyle, "corefile-style", CommandCompletions::eNoCompletion, { nullptr, false }, "The type of corefile that lldb will try to create, dependant on this target's capabilities." }, - { eArgTypeLogHandler, "log-handler", CommandCompletions::eNoCompletion, { nullptr, false }, "The log handle that will be used to write out log messages." }, - { eArgTypeSEDStylePair, "substitution-pair", CommandCompletions::eNoCompletion, { nullptr, false }, "A sed-style pattern and target pair." }, - { eArgTypeRecognizerID, "frame-recognizer-id", CommandCompletions::eNoCompletion, { nullptr, false }, "The ID for a stack frame recognizer." }, - { eArgTypeConnectURL, "process-connect-url", CommandCompletions::eNoCompletion, { nullptr, false }, "A URL-style specification for a remote connection." }, - { eArgTypeTargetID, "target-id", CommandCompletions::eNoCompletion, { nullptr, false }, "The index ID for an lldb Target." }, - { eArgTypeStopHookID, "stop-hook-id", CommandCompletions::eNoCompletion, { nullptr, false }, "The ID you receive when you create a stop-hook." } - // clang-format on -}; - -static_assert( - (sizeof(g_arguments_data) / sizeof(CommandObject::ArgumentTableEntry)) == - eArgTypeLastArg, - "g_arguments_data out of sync with CommandArgumentType enumeration"); - -const CommandObject::ArgumentTableEntry *CommandObject::GetArgumentTable() { - return g_arguments_data; -} |