19 return "Register names can be specified using the architecture specific "
21 "They can also be specified using generic names. Not all generic "
23 "registers backing them on all architectures. When they don't the "
25 "will return an error.\n"
26 "The generic names defined in lldb are:\n"
28 "pc - program counter register\n"
29 "ra - return address register\n"
30 "fp - frame pointer register\n"
31 "sp - stack pointer register\n"
32 "flags - the flags register\n"
33 "arg{1-6} - integer argument passing registers.\n";
37 return "Breakpoints are identified using major and minor numbers; the major "
38 "number corresponds to the single entity that was created with a "
40 "set' command; the minor numbers correspond to all the locations that "
42 "actually found/set based on the major breakpoint. A full breakpoint "
44 "look like 3.14, meaning the 14th location set for the 3rd "
46 "can specify all the locations of a breakpoint by just indicating the "
48 "breakpoint number. A valid breakpoint ID consists either of just the "
50 "number, or the major number followed by a dot and the location "
52 "3 or 3.2 could both be valid breakpoint IDs.)\n"
54 "You can use . to refer to the breakpoint location(s) at which the "
55 "current thread is stopped.";
59 return "A 'breakpoint ID list' is a manner of specifying multiple "
61 "This can be done through several mechanisms. The easiest way is to "
63 "enter a space-separated list of breakpoint IDs. To specify all the "
64 "breakpoint locations under a major breakpoint, you can use the major "
65 "breakpoint number followed by '.*', eg. '5.*' means all the "
67 "breakpoint 5. You can also indicate a range of breakpoints by using "
68 "<start-bp-id> - <end-bp-id>. The start-bp-id and end-bp-id for a "
70 "be any valid breakpoint IDs. It is not legal, however, to specify a "
72 "using specific locations that cross major breakpoint numbers. I.e. "
74 " is legal; 2 - 5 is legal; but 3.2 - 4.4 is not legal.";
78 return "A name that can be added to a breakpoint when it is created, or "
80 "on with the \"breakpoint name add\" command. "
81 "Breakpoint names can be used to specify breakpoints in all the "
82 "places breakpoint IDs "
83 "and breakpoint ID ranges can be used. As such they provide a "
84 "convenient way to group breakpoints, "
85 "and to operate on breakpoints you create without having to track the "
87 "Note, the attributes you set when using a breakpoint name in a "
88 "breakpoint command don't "
89 "adhere to the name, but instead are set individually on all the "
90 "breakpoints currently tagged with that "
91 "name. Future breakpoints "
92 "tagged with that name will not pick up the attributes previously "
93 "given using that name. "
94 "In order to distinguish breakpoint names from breakpoint IDs and "
96 "names must start with a letter from a-z or A-Z and cannot contain "
97 "spaces, \".\" or \"-\". "
98 "Also, breakpoint names can only be applied to breakpoints, not to "
99 "breakpoint locations.";
103 return "A GDB format consists of a repeat count, a format letter and a size "
105 "The repeat count is optional and defaults to 1. The format letter is "
107 "and defaults to the previous format that was used. The size letter "
109 "and defaults to the previous size that was used.\n"
111 "Format letters include:\n"
115 "u - unsigned decimal\n"
125 "Size letters include:\n"
126 "b - 1 byte (byte)\n"
127 "h - 2 bytes (halfword)\n"
128 "w - 4 bytes (word)\n"
129 "g - 8 bytes (giant)\n"
132 "32xb - show 32 1 byte hexadecimal integer values\n"
133 "16xh - show 16 2 byte hexadecimal integer values\n"
134 "64 - show 64 2 byte hexadecimal integer values (format and size "
135 "from the last format)\n"
136 "dw - show 1 4 byte decimal integer value\n";
140 static std::string help_text;
142 if (!help_text.empty())
146 sstr <<
"One of the format names (or one-character names) that can be used "
147 "to show a variable's value:\n";
154 sstr.
Printf(
"'%c' or ", format_char);
161 help_text = std::string(sstr.
GetString());
167 static std::string help_text;
169 if (!help_text.empty())
173 sstr <<
"One of the following languages:\n";
179 help_text = std::string(sstr.
GetString());
185 return "A summary string is a way to extract information from variables in "
186 "order to present them using a summary.\n"
187 "Summary strings contain static text, variables, scopes and control "
189 " - Static text can be any sequence of non-special characters, i.e. "
190 "anything but '{', '}', '$', or '\\'.\n"
191 " - Variables are sequences of characters beginning with ${, ending "
192 "with } and that contain symbols in the format described below.\n"
193 " - Scopes are any sequence of text between { and }. Anything "
194 "included in a scope will only appear in the output summary if there "
196 " - Control sequences are the usual C/C++ '\\a', '\\n', ..., plus "
197 "'\\$', '\\{' and '\\}'.\n"
198 "A summary string works by copying static text verbatim, turning "
199 "control sequences into their character counterpart, expanding "
200 "variables and trying to expand scopes.\n"
201 "A variable is expanded by giving it a value other than its textual "
202 "representation, and the way this is done depends on what comes after "
204 "The most common sequence if ${var followed by an expression path, "
205 "which is the text one would type to access a member of an aggregate "
206 "types, given a variable of that type"
207 " (e.g. if type T has a member named x, which has a member named y, "
208 "and if t is of type T, the expression path would be .x.y and the way "
209 "to fit that into a summary string would be"
210 " ${var.x.y}). You can also use ${*var followed by an expression path "
211 "and in that case the object referred by the path will be "
212 "dereferenced before being displayed."
213 " If the object is not a pointer, doing so will cause an error. For "
214 "additional details on expression paths, you can type 'help "
216 "By default, summary strings attempt to display the summary for any "
217 "variable they reference, and if that fails the value. If neither can "
218 "be shown, nothing is displayed."
219 "In a summary string, you can also use an array index [n], or a "
220 "slice-like range [n-m]. This can have two different meanings "
221 "depending on what kind of object the expression"
223 " - if it is a scalar type (any basic type like int, float, ...) the "
224 "expression is a bitfield, i.e. the bits indicated by the indexing "
225 "operator are extracted out of the number"
226 " and displayed as an individual variable\n"
227 " - if it is an array or pointer the array items indicated by the "
228 "indexing operator are shown as the result of the variable. if the "
229 "expression is an array, real array items are"
230 " printed; if it is a pointer, the pointer-as-array syntax is used to "
231 "obtain the values (this means, the latter case can have no range "
233 "If you are trying to display an array for which the size is known, "
234 "you can also use [] instead of giving an exact range. This has the "
235 "effect of showing items 0 thru size - 1.\n"
236 "Additionally, a variable can contain an (optional) format code, as "
237 "in ${var.x.y%code}, where code can be any of the valid formats "
238 "described in 'help format', or one of the"
239 " special symbols only allowed as part of a variable:\n"
240 " %V: show the value of the object by default\n"
241 " %S: show the summary of the object by default\n"
242 " %@: show the runtime-provided object description (for "
243 "Objective-C, it calls NSPrintForDebugger; for C/C++ it does "
245 " %L: show the location of the object (memory address or a "
247 " %#: show the number of children of the object\n"
248 " %T: show the type of the object\n"
249 "Another variable that you can use in summary strings is ${svar . "
250 "This sequence works exactly like ${var, including the fact that "
251 "${*svar is an allowed sequence, but uses"
252 " the object's synthetic children provider instead of the actual "
253 "objects. For instance, if you are using STL synthetic children "
254 "providers, the following summary string would"
255 " count the number of actual elements stored in an std::list:\n"
256 "type summary add -s \"${svar%#}\" -x \"std::list<\"";
260 return "An expression path is the sequence of symbols that is used in C/C++ "
261 "to access a member variable of an aggregate object (class).\n"
262 "For instance, given a class:\n"
268 "the expression to read item b in the item pointed to by next for foo "
269 "aFoo would be aFoo.next->b.\n"
270 "Given that aFoo could just be any object of type foo, the string "
271 "'.next->b' is the expression path, because it can be attached to any "
272 "foo instance to achieve the effect.\n"
273 "Expression paths in LLDB include dot (.) and arrow (->) operators, "
274 "and most commands using expression paths have ways to also accept "
275 "the star (*) operator.\n"
276 "The meaning of these operators is the same as the usual one given to "
277 "them by the C/C++ standards.\n"
278 "LLDB also has support for indexing ([ ]) in expression paths, and "
279 "extends the traditional meaning of the square brackets operator to "
280 "allow bitfield extraction:\n"
281 "for objects of native types (int, float, char, ...) saying '[n-m]' "
282 "as an expression path (where n and m are any positive integers, e.g. "
283 "[3-5]) causes LLDB to extract"
284 " bits n thru m from the value of the variable. If n == m, [n] is "
285 "also allowed as a shortcut syntax. For arrays and pointers, "
286 "expression paths can only contain one index"
287 " and the meaning of the operation is the same as the one defined by "
288 "C/C++ (item extraction). Some commands extend bitfield-like syntax "
289 "for arrays and pointers with the"
290 " meaning of array slicing (taking elements n thru m inside the array "
291 "or pointed-to memory).";
296 if (g_archs_help.
Empty()) {
300 g_archs_help.
Printf(
"These are the supported architecture names:\n");
301 archs.
Join(
"\n", g_archs_help);
309 "g_argument_table order doesn't match CommandArgumentType enumeration");
static void ListSupportedArchNames(StringList &list)
static void PrintAllLanguages(Stream &s, const char *prefix, const char *suffix)
void Flush() override
Flush the stream.
llvm::StringRef GetString() const
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
void Join(const char *separator, Stream &strm)
A class that represents a running process on the host machine.
llvm::StringRef GDBFormatHelpTextCallback()
llvm::StringRef arch_helper()
llvm::StringRef SummaryStringHelpTextCallback()
llvm::StringRef RegisterNameHelpTextCallback()
llvm::StringRef ExprPathHelpTextCallback()
llvm::StringRef BreakpointIDRangeHelpTextCallback()
TableValidator< 0 > validator
llvm::StringRef BreakpointIDHelpTextCallback()
llvm::StringRef LanguageTypeHelpTextCallback()
llvm::StringRef BreakpointNameHelpTextCallback()
llvm::StringRef FormatHelpTextCallback()
static constexpr CommandObject::ArgumentTableEntry g_argument_table[]
Format
Display format definitions.