LLDB mainline
CommandOptionArgumentTable.h
Go to the documentation of this file.
1//===-- CommandOptionArgumentTable.h ----------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_INTERPRETER_COMMANDOPTIONARGUMENTTABLE_H
10#define LLDB_INTERPRETER_COMMANDOPTIONARGUMENTTABLE_H
11
13
14namespace lldb_private {
15
16static constexpr OptionEnumValueElement g_corefile_save_style[] = {
17 {lldb::eSaveCoreFull, "full", "Create a core file with all memory saved"},
18 {lldb::eSaveCoreDirtyOnly, "modified-memory",
19 "Create a corefile with only modified memory saved"},
21 "Create a corefile with only stack memory saved"},
22};
23
24static constexpr OptionEnumValueElement g_description_verbosity_type[] = {
25 {
27 "compact",
28 "Only show the description string",
29 },
30 {
32 "full",
33 "Show the full output, including persistent variable's name and type",
34 },
35};
36
37static constexpr OptionEnumValueElement g_sort_option_enumeration[] = {
38 {
40 "none",
41 "No sorting, use the original symbol table order.",
42 },
43 {
45 "address",
46 "Sort output by symbol address.",
47 },
48 {
50 "name",
51 "Sort output by symbol name.",
52 },
53};
54
55// Note that the negation in the argument name causes a slightly confusing
56// mapping of the enum values.
57static constexpr OptionEnumValueElement g_dependents_enumeration[] = {
58 {
60 "default",
61 "Only load dependents when the target is an executable.",
62 },
63 {
65 "true",
66 "Don't load dependents, even if the target is an executable.",
67 },
68 {
70 "false",
71 "Load dependents, even if the target is not an executable.",
72 },
73};
74
75// FIXME: "script-type" needs to have its contents determined dynamically, so
76// somebody can add a new scripting language to lldb and have it pickable here
77// without having to change this enumeration by hand and rebuild lldb proper.
78static constexpr OptionEnumValueElement g_script_option_enumeration[] = {
79 {
81 "command",
82 "Commands are in the lldb command interpreter language",
83 },
84 {
86 "python",
87 "Commands are in the Python language.",
88 },
89 {
91 "lua",
92 "Commands are in the Lua language.",
93 },
94 {
96 "default",
97 "Commands are in the default scripting language.",
98 },
99};
100
101static constexpr OptionEnumValueElement g_log_handler_type[] = {
102 {
104 "default",
105 "Use the default (stream) log handler",
106 },
107 {
109 "stream",
110 "Write log messages to the debugger output stream or to a file if one "
111 "is specified. A buffer size (in bytes) can be specified with -b. If "
112 "no buffer size is specified the output is unbuffered.",
113 },
114 {
116 "circular",
117 "Write log messages to a fixed size circular buffer. A buffer size "
118 "(number of messages) must be specified with -b.",
119 },
120 {
122 "os",
123 "Write log messages to the operating system log.",
124 },
125};
126
127static constexpr OptionEnumValueElement g_script_synchro_type[] = {
128 {
130 "synchronous",
131 "Run synchronous",
132 },
133 {
135 "asynchronous",
136 "Run asynchronous",
137 },
138 {
140 "current",
141 "Do not alter current setting",
142 },
143};
144
145static constexpr OptionEnumValueElement g_running_mode[] = {
146 {lldb::eOnlyThisThread, "this-thread", "Run only this thread"},
147 {lldb::eAllThreads, "all-threads", "Run all threads"},
148 {lldb::eOnlyDuringStepping, "while-stepping",
149 "Run only this thread while stepping"},
150};
151
152llvm::StringRef RegisterNameHelpTextCallback();
153llvm::StringRef BreakpointIDHelpTextCallback();
154llvm::StringRef BreakpointIDRangeHelpTextCallback();
155llvm::StringRef BreakpointNameHelpTextCallback();
156llvm::StringRef GDBFormatHelpTextCallback();
157llvm::StringRef FormatHelpTextCallback();
158llvm::StringRef LanguageTypeHelpTextCallback();
159llvm::StringRef SummaryStringHelpTextCallback();
160llvm::StringRef ExprPathHelpTextCallback();
161llvm::StringRef arch_helper();
162
164 // clang-format off
165 { lldb::eArgTypeAddress, "address", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "A valid address in the target program's execution space." },
166 { lldb::eArgTypeAddressOrExpression, "address-expression", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "An expression that resolves to an address." },
167 { lldb::eArgTypeAliasName, "alias-name", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "The name of an abbreviation (alias) for a debugger command." },
168 { lldb::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.)" },
169 { lldb::eArgTypeArchitecture, "arch", CommandCompletions::eArchitectureCompletion, {}, { arch_helper, true }, "The architecture name, e.g. i386 or x86_64." },
170 { lldb::eArgTypeBoolean, "boolean", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "A Boolean value: 'true' or 'false'" },
174 { lldb::eArgTypeByteSize, "byte-size", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Number of bytes to use." },
175 { lldb::eArgTypeClassName, "class-name", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Then name of a class from the debug information in the program." },
176 { lldb::eArgTypeCommandName, "cmd-name", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "A debugger command (may be multiple words), without any options or arguments." },
177 { lldb::eArgTypeCount, "count", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "An unsigned integer." },
178 { lldb::eArgTypeDescriptionVerbosity, "description-verbosity", CommandCompletions::eNoCompletion, g_description_verbosity_type, { nullptr, false }, "How verbose the output of 'po' should be." },
179 { lldb::eArgTypeDirectoryName, "directory", CommandCompletions::eDiskDirectoryCompletion, {}, { nullptr, false }, "A directory name." },
180 { lldb::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" },
181 { lldb::eArgTypeEndAddress, "end-address", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Help text goes here." },
182 { lldb::eArgTypeExpression, "expr", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Help text goes here." },
184 { lldb::eArgTypeExprFormat, "expression-format", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "[ [bool|b] | [bin] | [char|c] | [oct|o] | [dec|i|d|u] | [hex|x] | [float|f] | [cstr|s] ]" },
185 { lldb::eArgTypeFileLineColumn, "linespec", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "A source specifier in the form file:line[:column]" },
186 { lldb::eArgTypeFilename, "filename", CommandCompletions::eDiskFileCompletion, {}, { nullptr, false }, "The name of a file (can include path)." },
188 { lldb::eArgTypeFrameIndex, "frame-index", CommandCompletions::eFrameIndexCompletion, {}, { nullptr, false }, "Index into a thread's list of frames." },
189 { lldb::eArgTypeFullName, "fullname", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Help text goes here." },
190 { lldb::eArgTypeFunctionName, "function-name", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "The name of a function." },
191 { lldb::eArgTypeFunctionOrSymbol, "function-or-symbol", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "The name of a function or symbol." },
193 { lldb::eArgTypeHelpText, "help-text", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Text to be used as help for some other entity in LLDB" },
194 { lldb::eArgTypeIndex, "index", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "An index into a list." },
196 { lldb::eArgTypeLineNum, "linenum", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Line number in a source file." },
197 { lldb::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." },
198 { lldb::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)." },
199 { lldb::eArgTypeMethod, "method", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "A C++ method name." },
200 { lldb::eArgTypeName, "name", CommandCompletions::eTypeCategoryNameCompletion, {}, { nullptr, false }, "Help text goes here." },
201 { lldb::eArgTypeNewPathPrefix, "new-path-prefix", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Help text goes here." },
202 { lldb::eArgTypeNumLines, "num-lines", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "The number of lines to use." },
203 { lldb::eArgTypeNumberPerLine, "number-per-line", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "The number of items per line to display." },
204 { lldb::eArgTypeOffset, "offset", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Help text goes here." },
205 { lldb::eArgTypeOldPathPrefix, "old-path-prefix", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Help text goes here." },
206 { lldb::eArgTypeOneLiner, "one-line-command", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "A command that is entered as a single line of text." },
207 { lldb::eArgTypePath, "path", CommandCompletions::eDiskFileCompletion, {}, { nullptr, false }, "Path." },
208 { lldb::eArgTypePermissionsNumber, "perms-numeric", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Permissions given as an octal number (e.g. 755)." },
209 { lldb::eArgTypePermissionsString, "perms=string", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Permissions given as a string value (e.g. rw-r-xr--)." },
210 { lldb::eArgTypePid, "pid", CommandCompletions::eProcessIDCompletion, {}, { nullptr, false }, "The process ID number." },
211 { lldb::eArgTypePlugin, "plugin", CommandCompletions::eProcessPluginCompletion, {}, { nullptr, false }, "Help text goes here." },
212 { lldb::eArgTypeProcessName, "process-name", CommandCompletions::eProcessNameCompletion, {}, { nullptr, false }, "The name of the process." },
213 { lldb::eArgTypePythonClass, "python-class", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "The name of a Python class." },
214 { lldb::eArgTypePythonFunction, "python-function", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "The name of a Python function." },
215 { lldb::eArgTypePythonScript, "python-script", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Source code written in Python." },
216 { lldb::eArgTypeQueueName, "queue-name", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "The name of the thread queue." },
218 { lldb::eArgTypeRegularExpression, "regular-expression", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "A POSIX-compliant extended regular expression." },
219 { lldb::eArgTypeRunArgs, "run-args", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Arguments to be passed to the target program when it starts executing." },
220 { lldb::eArgTypeRunMode, "run-mode", CommandCompletions::eNoCompletion, g_running_mode, { nullptr, false }, "Help text goes here." },
221 { lldb::eArgTypeScriptedCommandSynchronicity, "script-cmd-synchronicity", CommandCompletions::eNoCompletion, g_script_synchro_type, { nullptr, false }, "The synchronicity to use to run scripted commands with regard to LLDB event system." },
222 { lldb::eArgTypeScriptLang, "script-language", CommandCompletions::eNoCompletion, g_script_option_enumeration, { nullptr, false }, "The scripting language to be used for script-based commands. Supported languages are python and lua." },
223 { lldb::eArgTypeSearchWord, "search-word", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Any word of interest for search purposes." },
224 { lldb::eArgTypeSelector, "selector", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "An Objective-C selector name." },
225 { lldb::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)." },
226 { lldb::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)." },
227 { lldb::eArgTypeSettingPrefix, "setting-prefix", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "The name of a settable internal debugger variable up to a dot ('.'), e.g. 'target.process.'" },
228 { lldb::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." },
229 { lldb::eArgTypeShlibName, "shlib-name", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "The name of a shared library." },
230 { lldb::eArgTypeSourceFile, "source-file", CommandCompletions::eSourceFileCompletion, {}, { nullptr, false }, "The name of a source file.." },
231 { lldb::eArgTypeSortOrder, "sort-order", CommandCompletions::eNoCompletion, g_sort_option_enumeration, { nullptr, false }, "Specify a sort order when dumping lists." },
232 { lldb::eArgTypeStartAddress, "start-address", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Help text goes here." },
234 { lldb::eArgTypeSymbol, "symbol", CommandCompletions::eSymbolCompletion, {}, { nullptr, false }, "Any symbol name (function name, variable, argument, etc.)" },
235 { lldb::eArgTypeThreadID, "thread-id", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Thread ID number." },
236 { lldb::eArgTypeThreadIndex, "thread-index", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Index into the process' list of threads." },
237 { lldb::eArgTypeThreadName, "thread-name", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "The thread's name." },
238 { lldb::eArgTypeTypeName, "type-name", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "A type name." },
239 { lldb::eArgTypeUnsignedInteger, "unsigned-integer", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "An unsigned integer." },
240 { lldb::eArgTypeUnixSignal, "unix-signal", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "A valid Unix signal name or number (e.g. SIGKILL, KILL or 9)." },
241 { lldb::eArgTypeVarName, "variable-name", CommandCompletions::eNoCompletion, {} ,{ nullptr, false }, "The name of a variable in your program." },
242 { lldb::eArgTypeValue, "value", CommandCompletions::eNoCompletion, g_dependents_enumeration, { nullptr, false }, "A value could be anything, depending on where and how it is used." },
243 { lldb::eArgTypeWidth, "width", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Help text goes here." },
244 { lldb::eArgTypeNone, "none", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "No help available for this." },
245 { lldb::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." },
246 { lldb::eArgTypeWatchpointID, "watchpt-id", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Watchpoint IDs are positive integers." },
247 { lldb::eArgTypeWatchpointIDRange, "watchpt-id-list", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "For example, '1-3' or '1 to 3'." },
248 { lldb::eArgTypeWatchType, "watch-type", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Specify the type for a watchpoint." },
249 { lldb::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." },
250 { lldb::eArgTypeCommand, "command", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "An LLDB Command line command element." },
251 { lldb::eArgTypeColumnNum, "column", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "Column number in a source file." },
252 { lldb::eArgTypeModuleUUID, "module-uuid", CommandCompletions::eModuleUUIDCompletion, {}, { nullptr, false }, "A module UUID value." },
253 { lldb::eArgTypeSaveCoreStyle, "corefile-style", CommandCompletions::eNoCompletion, g_corefile_save_style, { nullptr, false }, "The type of corefile that lldb will try to create, dependant on this target's capabilities." },
254 { lldb::eArgTypeLogHandler, "log-handler", CommandCompletions::eNoCompletion, g_log_handler_type ,{ nullptr, false }, "The log handle that will be used to write out log messages." },
255 { lldb::eArgTypeSEDStylePair, "substitution-pair", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "A sed-style pattern and target pair." },
256 { lldb::eArgTypeRecognizerID, "frame-recognizer-id", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "The ID for a stack frame recognizer." },
257 { lldb::eArgTypeConnectURL, "process-connect-url", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "A URL-style specification for a remote connection." },
258 { lldb::eArgTypeTargetID, "target-id", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "The index ID for an lldb Target." },
259 { lldb::eArgTypeStopHookID, "stop-hook-id", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "The ID you receive when you create a stop-hook." },
260 // clang-format on
261};
262
263static_assert((sizeof(g_argument_table) /
264 sizeof(CommandObject::ArgumentTableEntry)) ==
266 "number of elements in g_argument_table doesn't match "
267 "CommandArgumentType enumeration");
268
269} // namespace lldb_private
270
271#endif // LLDB_INTERPRETER_COMMANDOPTIONARGUMENTTABLE_H
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
llvm::StringRef GDBFormatHelpTextCallback()
static constexpr OptionEnumValueElement g_script_option_enumeration[]
static constexpr OptionEnumValueElement g_log_handler_type[]
static constexpr OptionEnumValueElement g_running_mode[]
static constexpr OptionEnumValueElement g_dependents_enumeration[]
llvm::StringRef arch_helper()
static constexpr OptionEnumValueElement g_description_verbosity_type[]
llvm::StringRef SummaryStringHelpTextCallback()
llvm::StringRef RegisterNameHelpTextCallback()
llvm::StringRef ExprPathHelpTextCallback()
static constexpr OptionEnumValueElement g_corefile_save_style[]
llvm::StringRef BreakpointIDRangeHelpTextCallback()
llvm::StringRef BreakpointIDHelpTextCallback()
static constexpr OptionEnumValueElement g_sort_option_enumeration[]
llvm::StringRef LanguageTypeHelpTextCallback()
llvm::StringRef BreakpointNameHelpTextCallback()
llvm::StringRef FormatHelpTextCallback()
static constexpr CommandObject::ArgumentTableEntry g_argument_table[]
@ eLanguageRuntimeDescriptionDisplayVerbosityCompact
static constexpr OptionEnumValueElement g_script_synchro_type[]
@ eScriptLanguageLua
@ eScriptLanguageNone
@ eScriptLanguagePython
@ eSaveCoreStackOnly
@ eSaveCoreDirtyOnly
@ eArgTypeSEDStylePair
@ eArgTypeExpressionPath
@ eArgTypeBreakpointIDRange
@ eArgTypePythonFunction
@ eArgTypePermissionsNumber
@ eArgTypeOneLiner
@ eArgTypeNumberPerLine
@ eArgTypePermissionsString
@ eArgTypeLogCategory
@ eArgTypeDescriptionVerbosity
@ eArgTypeOldPathPrefix
@ eArgTypeEndAddress
@ eArgTypeTargetID
@ eArgTypeArchitecture
@ eArgTypeProcessName
@ eArgTypeShlibName
@ eArgTypeGDBFormat
@ eArgTypeSettingKey
@ eArgTypeBreakpointID
@ eArgTypeThreadID
@ eArgTypeByteSize
@ eArgTypeThreadIndex
@ eArgTypeSearchWord
@ eArgTypeExprFormat
@ eArgTypeNewPathPrefix
@ eArgTypeFilename
@ eArgTypeExpression
@ eArgTypeStartAddress
@ eArgTypeLogHandler
@ eArgTypeSettingPrefix
@ eArgTypeThreadName
@ eArgTypeColumnNum
@ eArgTypePythonClass
@ eArgTypeFileLineColumn
@ eArgTypeFullName
@ eArgTypeCommandName
@ eArgTypeSummaryString
@ eArgTypeFrameIndex
@ eArgTypePythonScript
@ eArgTypeAliasName
@ eArgTypeRecognizerID
@ eArgTypeWatchpointID
@ eArgTypeLogChannel
@ eArgTypeFunctionOrSymbol
@ eArgTypeSettingIndex
@ eArgTypeConnectURL
@ eArgTypeSettingVariableName
@ eArgTypeSourceFile
@ eArgTypeLanguage
@ eArgTypeDisassemblyFlavor
@ eArgTypeRegisterName
@ eArgTypeNumLines
@ eArgTypeBreakpointName
@ eArgTypeQueueName
@ eArgTypeTypeName
@ eArgTypePlatform
@ eArgTypeScriptedCommandSynchronicity
@ eArgTypeHelpText
@ eArgTypeWatchpointIDRange
@ eArgTypeSaveCoreStyle
@ eArgTypeSelector
@ eArgTypeRegularExpression
@ eArgTypeScriptLang
@ eArgTypeUnsignedInteger
@ eArgTypeSortOrder
@ eArgTypeModuleUUID
@ eArgTypeWatchType
@ eArgTypeFunctionName
@ eArgTypeAliasOptions
@ eArgTypeDirectoryName
@ eArgTypeAddressOrExpression
@ eArgTypeUnixSignal
@ eArgTypeClassName
@ eArgTypeStopHookID
@ eOnlyDuringStepping
Entries in the main argument information table.
Definition: CommandObject.h:83