LLDB  mainline
CommandObject.cpp
Go to the documentation of this file.
1 //===-- CommandObject.cpp -------------------------------------------------===//
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 
10 
11 #include <map>
12 #include <sstream>
13 #include <string>
14 
15 #include <cctype>
16 #include <cstdlib>
17 
18 #include "lldb/Core/Address.h"
20 #include "lldb/Utility/ArchSpec.h"
21 #include "llvm/ADT/ScopeExit.h"
22 
23 // These are for the Sourcename completers.
24 // FIXME: Make a separate file for the completers.
25 #include "lldb/Core/FileSpecList.h"
27 #include "lldb/Target/Process.h"
28 #include "lldb/Target/Target.h"
29 #include "lldb/Utility/FileSpec.h"
30 
31 #include "lldb/Target/Language.h"
32 
35 
36 using namespace lldb;
37 using namespace lldb_private;
38 
39 // CommandObject
40 
41 CommandObject::CommandObject(CommandInterpreter &interpreter,
42  llvm::StringRef name, llvm::StringRef help,
43  llvm::StringRef syntax, uint32_t flags)
44  : m_interpreter(interpreter), m_cmd_name(std::string(name)),
45  m_flags(flags), m_deprecated_command_override_callback(nullptr),
46  m_command_override_callback(nullptr), m_command_override_baton(nullptr) {
48  m_cmd_syntax = std::string(syntax);
49 }
50 
52 
53 llvm::StringRef CommandObject::GetHelp() { return m_cmd_help_short; }
54 
55 llvm::StringRef CommandObject::GetHelpLong() { return m_cmd_help_long; }
56 
57 llvm::StringRef CommandObject::GetSyntax() {
58  if (!m_cmd_syntax.empty())
59  return m_cmd_syntax;
60 
61  StreamString syntax_str;
62  syntax_str.PutCString(GetCommandName());
63 
64  if (!IsDashDashCommand() && GetOptions() != nullptr)
65  syntax_str.PutCString(" <cmd-options>");
66 
67  if (!m_arguments.empty()) {
68  syntax_str.PutCString(" ");
69 
71  GetOptions()->NumCommandOptions())
72  syntax_str.PutCString("-- ");
73  GetFormattedCommandArguments(syntax_str);
74  }
75  m_cmd_syntax = std::string(syntax_str.GetString());
76 
77  return m_cmd_syntax;
78 }
79 
80 llvm::StringRef CommandObject::GetCommandName() const { return m_cmd_name; }
81 
82 void CommandObject::SetCommandName(llvm::StringRef name) {
83  m_cmd_name = std::string(name);
84 }
85 
86 void CommandObject::SetHelp(llvm::StringRef str) {
88 }
89 
90 void CommandObject::SetHelpLong(llvm::StringRef str) {
92 }
93 
94 void CommandObject::SetSyntax(llvm::StringRef str) {
96 }
97 
99  // By default commands don't have options unless this virtual function is
100  // overridden by base classes.
101  return nullptr;
102 }
103 
105  // See if the subclass has options?
106  Options *options = GetOptions();
107  if (options != nullptr) {
108  Status error;
109 
110  auto exe_ctx = GetCommandInterpreter().GetExecutionContext();
111  options->NotifyOptionParsingStarting(&exe_ctx);
112 
113  const bool require_validation = true;
114  llvm::Expected<Args> args_or = options->Parse(
115  args, &exe_ctx, GetCommandInterpreter().GetPlatform(true),
116  require_validation);
117 
118  if (args_or) {
119  args = std::move(*args_or);
120  error = options->NotifyOptionParsingFinished(&exe_ctx);
121  } else
122  error = args_or.takeError();
123 
124  if (error.Success()) {
125  if (options->VerifyOptions(result))
126  return true;
127  } else {
128  const char *error_cstr = error.AsCString();
129  if (error_cstr) {
130  // We got an error string, lets use that
131  result.AppendError(error_cstr);
132  } else {
133  // No error string, output the usage information into result
134  options->GenerateOptionUsage(
135  result.GetErrorStream(), this,
136  GetCommandInterpreter().GetDebugger().GetTerminalWidth());
137  }
138  }
140  return false;
141  }
142  return true;
143 }
144 
146  // Nothing should be stored in m_exe_ctx between running commands as
147  // m_exe_ctx has shared pointers to the target, process, thread and frame and
148  // we don't want any CommandObject instances to keep any of these objects
149  // around longer than for a single command. Every command should call
150  // CommandObject::Cleanup() after it has completed.
151  assert(!m_exe_ctx.GetTargetPtr());
152  assert(!m_exe_ctx.GetProcessPtr());
153  assert(!m_exe_ctx.GetThreadPtr());
154  assert(!m_exe_ctx.GetFramePtr());
155 
156  // Lock down the interpreter's execution context prior to running the command
157  // so we guarantee the selected target, process, thread and frame can't go
158  // away during the execution
160 
161  const uint32_t flags = GetFlags().Get();
162  if (flags & (eCommandRequiresTarget | eCommandRequiresProcess |
163  eCommandRequiresThread | eCommandRequiresFrame |
164  eCommandTryTargetAPILock)) {
165 
166  if ((flags & eCommandRequiresTarget) && !m_exe_ctx.HasTargetScope()) {
168  return false;
169  }
170 
171  if ((flags & eCommandRequiresProcess) && !m_exe_ctx.HasProcessScope()) {
172  if (!m_exe_ctx.HasTargetScope())
174  else
176  return false;
177  }
178 
179  if ((flags & eCommandRequiresThread) && !m_exe_ctx.HasThreadScope()) {
180  if (!m_exe_ctx.HasTargetScope())
182  else if (!m_exe_ctx.HasProcessScope())
184  else
186  return false;
187  }
188 
189  if ((flags & eCommandRequiresFrame) && !m_exe_ctx.HasFrameScope()) {
190  if (!m_exe_ctx.HasTargetScope())
192  else if (!m_exe_ctx.HasProcessScope())
194  else if (!m_exe_ctx.HasThreadScope())
196  else
198  return false;
199  }
200 
201  if ((flags & eCommandRequiresRegContext) &&
202  (m_exe_ctx.GetRegisterContext() == nullptr)) {
204  return false;
205  }
206 
207  if (flags & eCommandTryTargetAPILock) {
208  Target *target = m_exe_ctx.GetTargetPtr();
209  if (target)
210  m_api_locker =
211  std::unique_lock<std::recursive_mutex>(target->GetAPIMutex());
212  }
213  }
214 
215  if (GetFlags().AnySet(eCommandProcessMustBeLaunched |
216  eCommandProcessMustBePaused)) {
218  if (process == nullptr) {
219  // A process that is not running is considered paused.
220  if (GetFlags().Test(eCommandProcessMustBeLaunched)) {
221  result.AppendError("Process must exist.");
222  return false;
223  }
224  } else {
225  StateType state = process->GetState();
226  switch (state) {
227  case eStateInvalid:
228  case eStateSuspended:
229  case eStateCrashed:
230  case eStateStopped:
231  break;
232 
233  case eStateConnected:
234  case eStateAttaching:
235  case eStateLaunching:
236  case eStateDetached:
237  case eStateExited:
238  case eStateUnloaded:
239  if (GetFlags().Test(eCommandProcessMustBeLaunched)) {
240  result.AppendError("Process must be launched.");
241  return false;
242  }
243  break;
244 
245  case eStateRunning:
246  case eStateStepping:
247  if (GetFlags().Test(eCommandProcessMustBePaused)) {
248  result.AppendError("Process is running. Use 'process interrupt' to "
249  "pause execution.");
250  return false;
251  }
252  }
253  }
254  }
255 
256  if (GetFlags().Test(eCommandProcessMustBeTraced)) {
257  Target *target = m_exe_ctx.GetTargetPtr();
258  if (target && !target->GetTrace()) {
259  result.AppendError("Process is not being traced.");
260  return false;
261  }
262  }
263 
264  return true;
265 }
266 
268  m_exe_ctx.Clear();
269  if (m_api_locker.owns_lock())
270  m_api_locker.unlock();
271 }
272 
274 
276  auto reset_ctx = llvm::make_scope_exit([this]() { Cleanup(); });
277 
278  // Default implementation of WantsCompletion() is !WantsRawCommandString().
279  // Subclasses who want raw command string but desire, for example, argument
280  // completion should override WantsCompletion() to return true, instead.
282  // FIXME: Abstract telling the completion to insert the completion
283  // character.
284  return;
285  } else {
286  // Can we do anything generic with the options?
287  Options *cur_options = GetOptions();
289  OptionElementVector opt_element_vector;
290 
291  if (cur_options != nullptr) {
292  opt_element_vector = cur_options->ParseForCompletion(
293  request.GetParsedLine(), request.GetCursorIndex());
294 
295  bool handled_by_options = cur_options->HandleOptionCompletion(
296  request, opt_element_vector, GetCommandInterpreter());
297  if (handled_by_options)
298  return;
299  }
300 
301  // If we got here, the last word is not an option or an option argument.
302  HandleArgumentCompletion(request, opt_element_vector);
303  }
304 }
305 
306 bool CommandObject::HelpTextContainsWord(llvm::StringRef search_word,
307  bool search_short_help,
308  bool search_long_help,
309  bool search_syntax,
310  bool search_options) {
311  std::string options_usage_help;
312 
313  bool found_word = false;
314 
315  llvm::StringRef short_help = GetHelp();
316  llvm::StringRef long_help = GetHelpLong();
317  llvm::StringRef syntax_help = GetSyntax();
318 
319  if (search_short_help && short_help.contains_insensitive(search_word))
320  found_word = true;
321  else if (search_long_help && long_help.contains_insensitive(search_word))
322  found_word = true;
323  else if (search_syntax && syntax_help.contains_insensitive(search_word))
324  found_word = true;
325 
326  if (!found_word && search_options && GetOptions() != nullptr) {
327  StreamString usage_help;
329  usage_help, this,
330  GetCommandInterpreter().GetDebugger().GetTerminalWidth());
331  if (!usage_help.Empty()) {
332  llvm::StringRef usage_text = usage_help.GetString();
333  if (usage_text.contains_insensitive(search_word))
334  found_word = true;
335  }
336  }
337 
338  return found_word;
339 }
340 
342  CommandReturnObject &result,
343  OptionGroupOptions &group_options,
344  ExecutionContext &exe_ctx) {
345  if (!ParseOptions(args, result))
346  return false;
347 
348  Status error(group_options.NotifyOptionParsingFinished(&exe_ctx));
349  if (error.Fail()) {
350  result.AppendError(error.AsCString());
351  return false;
352  }
353  return true;
354 }
355 
357 
360  if (static_cast<size_t>(idx) < m_arguments.size())
361  return &(m_arguments[idx]);
362 
363  return nullptr;
364 }
365 
369 
370  for (int i = 0; i < eArgTypeLastArg; ++i)
371  if (table[i].arg_type == arg_type)
372  return &(table[i]);
373 
374  return nullptr;
375 }
376 
378  CommandInterpreter &interpreter) {
380  const ArgumentTableEntry *entry = &(table[arg_type]);
381 
382  // The table is *supposed* to be kept in arg_type order, but someone *could*
383  // have messed it up...
384 
385  if (entry->arg_type != arg_type)
386  entry = CommandObject::FindArgumentDataByType(arg_type);
387 
388  if (!entry)
389  return;
390 
391  StreamString name_str;
392  name_str.Printf("<%s>", entry->arg_name);
393 
394  if (entry->help_function) {
395  llvm::StringRef help_text = entry->help_function();
396  if (!entry->help_function.self_formatting) {
397  interpreter.OutputFormattedHelpText(str, name_str.GetString(), "--",
398  help_text, name_str.GetSize());
399  } else {
400  interpreter.OutputHelpText(str, name_str.GetString(), "--", help_text,
401  name_str.GetSize());
402  }
403  } else
404  interpreter.OutputFormattedHelpText(str, name_str.GetString(), "--",
405  entry->help_text, name_str.GetSize());
406 }
407 
409  const ArgumentTableEntry *entry =
410  &(CommandObject::GetArgumentTable()[arg_type]);
411 
412  // The table is *supposed* to be kept in arg_type order, but someone *could*
413  // have messed it up...
414 
415  if (entry->arg_type != arg_type)
416  entry = CommandObject::FindArgumentDataByType(arg_type);
417 
418  if (entry)
419  return entry->arg_name;
420 
421  return nullptr;
422 }
423 
425  return (arg_repeat_type == eArgRepeatPairPlain) ||
426  (arg_repeat_type == eArgRepeatPairOptional) ||
427  (arg_repeat_type == eArgRepeatPairPlus) ||
428  (arg_repeat_type == eArgRepeatPairStar) ||
429  (arg_repeat_type == eArgRepeatPairRange) ||
430  (arg_repeat_type == eArgRepeatPairRangeOptional);
431 }
432 
435  CommandObject::CommandArgumentEntry &cmd_arg_entry) {
437  for (unsigned i = 0; i < cmd_arg_entry.size(); ++i)
438  if (opt_set_mask & cmd_arg_entry[i].arg_opt_set_association)
439  ret_val.push_back(cmd_arg_entry[i]);
440  return ret_val;
441 }
442 
443 // Default parameter value of opt_set_mask is LLDB_OPT_SET_ALL, which means
444 // take all the argument data into account. On rare cases where some argument
445 // sticks with certain option sets, this function returns the option set
446 // filtered args.
448  uint32_t opt_set_mask) {
449  int num_args = m_arguments.size();
450  for (int i = 0; i < num_args; ++i) {
451  if (i > 0)
452  str.Printf(" ");
453  CommandArgumentEntry arg_entry =
454  opt_set_mask == LLDB_OPT_SET_ALL
455  ? m_arguments[i]
456  : OptSetFiltered(opt_set_mask, m_arguments[i]);
457  // This argument is not associated with the current option set, so skip it.
458  if (arg_entry.empty())
459  continue;
460  int num_alternatives = arg_entry.size();
461 
462  if ((num_alternatives == 2) && IsPairType(arg_entry[0].arg_repetition)) {
463  const char *first_name = GetArgumentName(arg_entry[0].arg_type);
464  const char *second_name = GetArgumentName(arg_entry[1].arg_type);
465  switch (arg_entry[0].arg_repetition) {
466  case eArgRepeatPairPlain:
467  str.Printf("<%s> <%s>", first_name, second_name);
468  break;
470  str.Printf("[<%s> <%s>]", first_name, second_name);
471  break;
472  case eArgRepeatPairPlus:
473  str.Printf("<%s> <%s> [<%s> <%s> [...]]", first_name, second_name,
474  first_name, second_name);
475  break;
476  case eArgRepeatPairStar:
477  str.Printf("[<%s> <%s> [<%s> <%s> [...]]]", first_name, second_name,
478  first_name, second_name);
479  break;
480  case eArgRepeatPairRange:
481  str.Printf("<%s_1> <%s_1> ... <%s_n> <%s_n>", first_name, second_name,
482  first_name, second_name);
483  break;
485  str.Printf("[<%s_1> <%s_1> ... <%s_n> <%s_n>]", first_name, second_name,
486  first_name, second_name);
487  break;
488  // Explicitly test for all the rest of the cases, so if new types get
489  // added we will notice the missing case statement(s).
490  case eArgRepeatPlain:
491  case eArgRepeatOptional:
492  case eArgRepeatPlus:
493  case eArgRepeatStar:
494  case eArgRepeatRange:
495  // These should not be reached, as they should fail the IsPairType test
496  // above.
497  break;
498  }
499  } else {
500  StreamString names;
501  for (int j = 0; j < num_alternatives; ++j) {
502  if (j > 0)
503  names.Printf(" | ");
504  names.Printf("%s", GetArgumentName(arg_entry[j].arg_type));
505  }
506 
507  std::string name_str = std::string(names.GetString());
508  switch (arg_entry[0].arg_repetition) {
509  case eArgRepeatPlain:
510  str.Printf("<%s>", name_str.c_str());
511  break;
512  case eArgRepeatPlus:
513  str.Printf("<%s> [<%s> [...]]", name_str.c_str(), name_str.c_str());
514  break;
515  case eArgRepeatStar:
516  str.Printf("[<%s> [<%s> [...]]]", name_str.c_str(), name_str.c_str());
517  break;
518  case eArgRepeatOptional:
519  str.Printf("[<%s>]", name_str.c_str());
520  break;
521  case eArgRepeatRange:
522  str.Printf("<%s_1> .. <%s_n>", name_str.c_str(), name_str.c_str());
523  break;
524  // Explicitly test for all the rest of the cases, so if new types get
525  // added we will notice the missing case statement(s).
526  case eArgRepeatPairPlain:
528  case eArgRepeatPairPlus:
529  case eArgRepeatPairStar:
530  case eArgRepeatPairRange:
532  // These should not be hit, as they should pass the IsPairType test
533  // above, and control should have gone into the other branch of the if
534  // statement.
535  break;
536  }
537  }
538  }
539 }
540 
542 CommandObject::LookupArgumentName(llvm::StringRef arg_name) {
543  CommandArgumentType return_type = eArgTypeLastArg;
544 
545  arg_name = arg_name.ltrim('<').rtrim('>');
546 
547  const ArgumentTableEntry *table = GetArgumentTable();
548  for (int i = 0; i < eArgTypeLastArg; ++i)
549  if (arg_name == table[i].arg_name)
550  return_type = g_arguments_data[i].arg_type;
551 
552  return return_type;
553 }
554 
555 static llvm::StringRef RegisterNameHelpTextCallback() {
556  return "Register names can be specified using the architecture specific "
557  "names. "
558  "They can also be specified using generic names. Not all generic "
559  "entities have "
560  "registers backing them on all architectures. When they don't the "
561  "generic name "
562  "will return an error.\n"
563  "The generic names defined in lldb are:\n"
564  "\n"
565  "pc - program counter register\n"
566  "ra - return address register\n"
567  "fp - frame pointer register\n"
568  "sp - stack pointer register\n"
569  "flags - the flags register\n"
570  "arg{1-6} - integer argument passing registers.\n";
571 }
572 
573 static llvm::StringRef BreakpointIDHelpTextCallback() {
574  return "Breakpoints are identified using major and minor numbers; the major "
575  "number corresponds to the single entity that was created with a "
576  "'breakpoint "
577  "set' command; the minor numbers correspond to all the locations that "
578  "were "
579  "actually found/set based on the major breakpoint. A full breakpoint "
580  "ID might "
581  "look like 3.14, meaning the 14th location set for the 3rd "
582  "breakpoint. You "
583  "can specify all the locations of a breakpoint by just indicating the "
584  "major "
585  "breakpoint number. A valid breakpoint ID consists either of just the "
586  "major "
587  "number, or the major number followed by a dot and the location "
588  "number (e.g. "
589  "3 or 3.2 could both be valid breakpoint IDs.)";
590 }
591 
592 static llvm::StringRef BreakpointIDRangeHelpTextCallback() {
593  return "A 'breakpoint ID list' is a manner of specifying multiple "
594  "breakpoints. "
595  "This can be done through several mechanisms. The easiest way is to "
596  "just "
597  "enter a space-separated list of breakpoint IDs. To specify all the "
598  "breakpoint locations under a major breakpoint, you can use the major "
599  "breakpoint number followed by '.*', eg. '5.*' means all the "
600  "locations under "
601  "breakpoint 5. You can also indicate a range of breakpoints by using "
602  "<start-bp-id> - <end-bp-id>. The start-bp-id and end-bp-id for a "
603  "range can "
604  "be any valid breakpoint IDs. It is not legal, however, to specify a "
605  "range "
606  "using specific locations that cross major breakpoint numbers. I.e. "
607  "3.2 - 3.7"
608  " is legal; 2 - 5 is legal; but 3.2 - 4.4 is not legal.";
609 }
610 
611 static llvm::StringRef BreakpointNameHelpTextCallback() {
612  return "A name that can be added to a breakpoint when it is created, or "
613  "later "
614  "on with the \"breakpoint name add\" command. "
615  "Breakpoint names can be used to specify breakpoints in all the "
616  "places breakpoint IDs "
617  "and breakpoint ID ranges can be used. As such they provide a "
618  "convenient way to group breakpoints, "
619  "and to operate on breakpoints you create without having to track the "
620  "breakpoint number. "
621  "Note, the attributes you set when using a breakpoint name in a "
622  "breakpoint command don't "
623  "adhere to the name, but instead are set individually on all the "
624  "breakpoints currently tagged with that "
625  "name. Future breakpoints "
626  "tagged with that name will not pick up the attributes previously "
627  "given using that name. "
628  "In order to distinguish breakpoint names from breakpoint IDs and "
629  "ranges, "
630  "names must start with a letter from a-z or A-Z and cannot contain "
631  "spaces, \".\" or \"-\". "
632  "Also, breakpoint names can only be applied to breakpoints, not to "
633  "breakpoint locations.";
634 }
635 
636 static llvm::StringRef GDBFormatHelpTextCallback() {
637  return "A GDB format consists of a repeat count, a format letter and a size "
638  "letter. "
639  "The repeat count is optional and defaults to 1. The format letter is "
640  "optional "
641  "and defaults to the previous format that was used. The size letter "
642  "is optional "
643  "and defaults to the previous size that was used.\n"
644  "\n"
645  "Format letters include:\n"
646  "o - octal\n"
647  "x - hexadecimal\n"
648  "d - decimal\n"
649  "u - unsigned decimal\n"
650  "t - binary\n"
651  "f - float\n"
652  "a - address\n"
653  "i - instruction\n"
654  "c - char\n"
655  "s - string\n"
656  "T - OSType\n"
657  "A - float as hex\n"
658  "\n"
659  "Size letters include:\n"
660  "b - 1 byte (byte)\n"
661  "h - 2 bytes (halfword)\n"
662  "w - 4 bytes (word)\n"
663  "g - 8 bytes (giant)\n"
664  "\n"
665  "Example formats:\n"
666  "32xb - show 32 1 byte hexadecimal integer values\n"
667  "16xh - show 16 2 byte hexadecimal integer values\n"
668  "64 - show 64 2 byte hexadecimal integer values (format and size "
669  "from the last format)\n"
670  "dw - show 1 4 byte decimal integer value\n";
671 }
672 
673 static llvm::StringRef FormatHelpTextCallback() {
674  static std::string help_text;
675 
676  if (!help_text.empty())
677  return help_text;
678 
679  StreamString sstr;
680  sstr << "One of the format names (or one-character names) that can be used "
681  "to show a variable's value:\n";
682  for (Format f = eFormatDefault; f < kNumFormats; f = Format(f + 1)) {
683  if (f != eFormatDefault)
684  sstr.PutChar('\n');
685 
686  char format_char = FormatManager::GetFormatAsFormatChar(f);
687  if (format_char)
688  sstr.Printf("'%c' or ", format_char);
689 
690  sstr.Printf("\"%s\"", FormatManager::GetFormatAsCString(f));
691  }
692 
693  sstr.Flush();
694 
695  help_text = std::string(sstr.GetString());
696 
697  return help_text;
698 }
699 
700 static llvm::StringRef LanguageTypeHelpTextCallback() {
701  static std::string help_text;
702 
703  if (!help_text.empty())
704  return help_text;
705 
706  StreamString sstr;
707  sstr << "One of the following languages:\n";
708 
709  Language::PrintAllLanguages(sstr, " ", "\n");
710 
711  sstr.Flush();
712 
713  help_text = std::string(sstr.GetString());
714 
715  return help_text;
716 }
717 
718 static llvm::StringRef SummaryStringHelpTextCallback() {
719  return "A summary string is a way to extract information from variables in "
720  "order to present them using a summary.\n"
721  "Summary strings contain static text, variables, scopes and control "
722  "sequences:\n"
723  " - Static text can be any sequence of non-special characters, i.e. "
724  "anything but '{', '}', '$', or '\\'.\n"
725  " - Variables are sequences of characters beginning with ${, ending "
726  "with } and that contain symbols in the format described below.\n"
727  " - Scopes are any sequence of text between { and }. Anything "
728  "included in a scope will only appear in the output summary if there "
729  "were no errors.\n"
730  " - Control sequences are the usual C/C++ '\\a', '\\n', ..., plus "
731  "'\\$', '\\{' and '\\}'.\n"
732  "A summary string works by copying static text verbatim, turning "
733  "control sequences into their character counterpart, expanding "
734  "variables and trying to expand scopes.\n"
735  "A variable is expanded by giving it a value other than its textual "
736  "representation, and the way this is done depends on what comes after "
737  "the ${ marker.\n"
738  "The most common sequence if ${var followed by an expression path, "
739  "which is the text one would type to access a member of an aggregate "
740  "types, given a variable of that type"
741  " (e.g. if type T has a member named x, which has a member named y, "
742  "and if t is of type T, the expression path would be .x.y and the way "
743  "to fit that into a summary string would be"
744  " ${var.x.y}). You can also use ${*var followed by an expression path "
745  "and in that case the object referred by the path will be "
746  "dereferenced before being displayed."
747  " If the object is not a pointer, doing so will cause an error. For "
748  "additional details on expression paths, you can type 'help "
749  "expr-path'. \n"
750  "By default, summary strings attempt to display the summary for any "
751  "variable they reference, and if that fails the value. If neither can "
752  "be shown, nothing is displayed."
753  "In a summary string, you can also use an array index [n], or a "
754  "slice-like range [n-m]. This can have two different meanings "
755  "depending on what kind of object the expression"
756  " path refers to:\n"
757  " - if it is a scalar type (any basic type like int, float, ...) the "
758  "expression is a bitfield, i.e. the bits indicated by the indexing "
759  "operator are extracted out of the number"
760  " and displayed as an individual variable\n"
761  " - if it is an array or pointer the array items indicated by the "
762  "indexing operator are shown as the result of the variable. if the "
763  "expression is an array, real array items are"
764  " printed; if it is a pointer, the pointer-as-array syntax is used to "
765  "obtain the values (this means, the latter case can have no range "
766  "checking)\n"
767  "If you are trying to display an array for which the size is known, "
768  "you can also use [] instead of giving an exact range. This has the "
769  "effect of showing items 0 thru size - 1.\n"
770  "Additionally, a variable can contain an (optional) format code, as "
771  "in ${var.x.y%code}, where code can be any of the valid formats "
772  "described in 'help format', or one of the"
773  " special symbols only allowed as part of a variable:\n"
774  " %V: show the value of the object by default\n"
775  " %S: show the summary of the object by default\n"
776  " %@: show the runtime-provided object description (for "
777  "Objective-C, it calls NSPrintForDebugger; for C/C++ it does "
778  "nothing)\n"
779  " %L: show the location of the object (memory address or a "
780  "register name)\n"
781  " %#: show the number of children of the object\n"
782  " %T: show the type of the object\n"
783  "Another variable that you can use in summary strings is ${svar . "
784  "This sequence works exactly like ${var, including the fact that "
785  "${*svar is an allowed sequence, but uses"
786  " the object's synthetic children provider instead of the actual "
787  "objects. For instance, if you are using STL synthetic children "
788  "providers, the following summary string would"
789  " count the number of actual elements stored in an std::list:\n"
790  "type summary add -s \"${svar%#}\" -x \"std::list<\"";
791 }
792 
793 static llvm::StringRef ExprPathHelpTextCallback() {
794  return "An expression path is the sequence of symbols that is used in C/C++ "
795  "to access a member variable of an aggregate object (class).\n"
796  "For instance, given a class:\n"
797  " class foo {\n"
798  " int a;\n"
799  " int b; .\n"
800  " foo* next;\n"
801  " };\n"
802  "the expression to read item b in the item pointed to by next for foo "
803  "aFoo would be aFoo.next->b.\n"
804  "Given that aFoo could just be any object of type foo, the string "
805  "'.next->b' is the expression path, because it can be attached to any "
806  "foo instance to achieve the effect.\n"
807  "Expression paths in LLDB include dot (.) and arrow (->) operators, "
808  "and most commands using expression paths have ways to also accept "
809  "the star (*) operator.\n"
810  "The meaning of these operators is the same as the usual one given to "
811  "them by the C/C++ standards.\n"
812  "LLDB also has support for indexing ([ ]) in expression paths, and "
813  "extends the traditional meaning of the square brackets operator to "
814  "allow bitfield extraction:\n"
815  "for objects of native types (int, float, char, ...) saying '[n-m]' "
816  "as an expression path (where n and m are any positive integers, e.g. "
817  "[3-5]) causes LLDB to extract"
818  " bits n thru m from the value of the variable. If n == m, [n] is "
819  "also allowed as a shortcut syntax. For arrays and pointers, "
820  "expression paths can only contain one index"
821  " and the meaning of the operation is the same as the one defined by "
822  "C/C++ (item extraction). Some commands extend bitfield-like syntax "
823  "for arrays and pointers with the"
824  " meaning of array slicing (taking elements n thru m inside the array "
825  "or pointed-to memory).";
826 }
827 
829  llvm::StringRef long_help) {
830  CommandInterpreter &interpreter = GetCommandInterpreter();
831  std::stringstream lineStream{std::string(long_help)};
832  std::string line;
833  while (std::getline(lineStream, line)) {
834  if (line.empty()) {
835  output_strm << "\n";
836  continue;
837  }
838  size_t result = line.find_first_not_of(" \t");
839  if (result == std::string::npos) {
840  result = 0;
841  }
842  std::string whitespace_prefix = line.substr(0, result);
843  std::string remainder = line.substr(result);
844  interpreter.OutputFormattedHelpText(output_strm, whitespace_prefix,
845  remainder);
846  }
847 }
848 
851 
853 }
854 
856  CommandInterpreter &interpreter = GetCommandInterpreter();
857  std::string help_text(GetHelp());
858  if (WantsRawCommandString()) {
859  help_text.append(" Expects 'raw' input (see 'help raw-input'.)");
860  }
861  interpreter.OutputFormattedHelpText(output_strm, "", help_text);
862  output_strm << "\nSyntax: " << GetSyntax() << "\n";
863  Options *options = GetOptions();
864  if (options != nullptr) {
865  options->GenerateOptionUsage(
866  output_strm, this,
867  GetCommandInterpreter().GetDebugger().GetTerminalWidth());
868  }
869  llvm::StringRef long_help = GetHelpLong();
870  if (!long_help.empty()) {
871  FormatLongHelpText(output_strm, long_help);
872  }
873  if (!IsDashDashCommand() && options && options->NumCommandOptions() > 0) {
875  // Emit the message about using ' -- ' between the end of the command
876  // options and the raw input conditionally, i.e., only if the command
877  // object does not want completion.
878  interpreter.OutputFormattedHelpText(
879  output_strm, "", "",
880  "\nImportant Note: Because this command takes 'raw' input, if you "
881  "use any command options"
882  " you must use ' -- ' between the end of the command options and the "
883  "beginning of the raw input.",
884  1);
885  } else if (GetNumArgumentEntries() > 0) {
886  // Also emit a warning about using "--" in case you are using a command
887  // that takes options and arguments.
888  interpreter.OutputFormattedHelpText(
889  output_strm, "", "",
890  "\nThis command takes options and free-form arguments. If your "
891  "arguments resemble"
892  " option specifiers (i.e., they start with a - or --), you must use "
893  "' -- ' between"
894  " the end of the command options and the beginning of the arguments.",
895  1);
896  }
897  }
898 }
899 
902  CommandArgumentType IDRange) {
903  CommandArgumentData id_arg;
904  CommandArgumentData id_range_arg;
905 
906  // Create the first variant for the first (and only) argument for this
907  // command.
908  id_arg.arg_type = ID;
910 
911  // Create the second variant for the first (and only) argument for this
912  // command.
913  id_range_arg.arg_type = IDRange;
914  id_range_arg.arg_repetition = eArgRepeatOptional;
915 
916  // The first (and only) argument for this command could be either an id or an
917  // id_range. Push both variants into the entry for the first argument for
918  // this command.
919  arg.push_back(id_arg);
920  arg.push_back(id_range_arg);
921 }
922 
924  const lldb::CommandArgumentType arg_type) {
925  assert(arg_type < eArgTypeLastArg &&
926  "Invalid argument type passed to GetArgumentTypeAsCString");
927  return g_arguments_data[arg_type].arg_name;
928 }
929 
931  const lldb::CommandArgumentType arg_type) {
932  assert(arg_type < eArgTypeLastArg &&
933  "Invalid argument type passed to GetArgumentDescriptionAsCString");
934  return g_arguments_data[arg_type].help_text;
935 }
936 
939 }
940 
942  return m_interpreter.GetDebugger().GetSelectedOrDummyTarget(prefer_dummy);
943 }
944 
946  assert(m_flags.AnySet(eCommandRequiresTarget | eCommandProcessMustBePaused |
947  eCommandProcessMustBeLaunched | eCommandRequiresFrame |
948  eCommandRequiresThread | eCommandRequiresProcess |
949  eCommandRequiresRegContext) &&
950  "GetSelectedTarget called from object that may have no target");
952 }
953 
955  Thread *thread_to_use = m_exe_ctx.GetThreadPtr();
956  if (thread_to_use)
957  return thread_to_use;
958 
959  Process *process = m_exe_ctx.GetProcessPtr();
960  if (!process) {
961  Target *target = m_exe_ctx.GetTargetPtr();
962  if (!target) {
963  target = m_interpreter.GetDebugger().GetSelectedTarget().get();
964  }
965  if (target)
966  process = target->GetProcessSP().get();
967  }
968 
969  if (process)
970  return process->GetThreadList().GetSelectedThread().get();
971  else
972  return nullptr;
973 }
974 
975 bool CommandObjectParsed::Execute(const char *args_string,
976  CommandReturnObject &result) {
977  bool handled = false;
978  Args cmd_args(args_string);
979  if (HasOverrideCallback()) {
980  Args full_args(GetCommandName());
981  full_args.AppendArguments(cmd_args);
982  handled =
983  InvokeOverrideCallback(full_args.GetConstArgumentVector(), result);
984  }
985  if (!handled) {
986  for (auto entry : llvm::enumerate(cmd_args.entries())) {
987  if (!entry.value().ref().empty() && entry.value().ref().front() == '`') {
988  cmd_args.ReplaceArgumentAtIndex(
989  entry.index(),
990  m_interpreter.ProcessEmbeddedScriptCommands(entry.value().c_str()));
991  }
992  }
993 
994  if (CheckRequirements(result)) {
995  if (ParseOptions(cmd_args, result)) {
996  // Call the command-specific version of 'Execute', passing it the
997  // already processed arguments.
998  handled = DoExecute(cmd_args, result);
999  }
1000  }
1001 
1002  Cleanup();
1003  }
1004  return handled;
1005 }
1006 
1007 bool CommandObjectRaw::Execute(const char *args_string,
1008  CommandReturnObject &result) {
1009  bool handled = false;
1010  if (HasOverrideCallback()) {
1011  std::string full_command(GetCommandName());
1012  full_command += ' ';
1013  full_command += args_string;
1014  const char *argv[2] = {nullptr, nullptr};
1015  argv[0] = full_command.c_str();
1016  handled = InvokeOverrideCallback(argv, result);
1017  }
1018  if (!handled) {
1019  if (CheckRequirements(result))
1020  handled = DoExecute(args_string, result);
1021 
1022  Cleanup();
1023  }
1024  return handled;
1025 }
1026 
1027 static llvm::StringRef arch_helper() {
1028  static StreamString g_archs_help;
1029  if (g_archs_help.Empty()) {
1030  StringList archs;
1031 
1033  g_archs_help.Printf("These are the supported architecture names:\n");
1034  archs.Join("\n", g_archs_help);
1035  }
1036  return g_archs_help.GetString();
1037 }
1038 
1040  // clang-format off
1041  { eArgTypeAddress, "address", CommandCompletions::eNoCompletion, { nullptr, false }, "A valid address in the target program's execution space." },
1042  { eArgTypeAddressOrExpression, "address-expression", CommandCompletions::eNoCompletion, { nullptr, false }, "An expression that resolves to an address." },
1043  { eArgTypeAliasName, "alias-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of an abbreviation (alias) for a debugger command." },
1044  { 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.)" },
1045  { eArgTypeArchitecture, "arch", CommandCompletions::eArchitectureCompletion, { arch_helper, true }, "The architecture name, e.g. i386 or x86_64." },
1046  { eArgTypeBoolean, "boolean", CommandCompletions::eNoCompletion, { nullptr, false }, "A Boolean value: 'true' or 'false'" },
1050  { eArgTypeByteSize, "byte-size", CommandCompletions::eNoCompletion, { nullptr, false }, "Number of bytes to use." },
1051  { eArgTypeClassName, "class-name", CommandCompletions::eNoCompletion, { nullptr, false }, "Then name of a class from the debug information in the program." },
1052  { eArgTypeCommandName, "cmd-name", CommandCompletions::eNoCompletion, { nullptr, false }, "A debugger command (may be multiple words), without any options or arguments." },
1053  { eArgTypeCount, "count", CommandCompletions::eNoCompletion, { nullptr, false }, "An unsigned integer." },
1054  { eArgTypeDirectoryName, "directory", CommandCompletions::eDiskDirectoryCompletion, { nullptr, false }, "A directory name." },
1055  { 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" },
1056  { eArgTypeDescriptionVerbosity, "description-verbosity", CommandCompletions::eNoCompletion, { nullptr, false }, "How verbose the output of 'po' should be." },
1057  { eArgTypeEndAddress, "end-address", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." },
1058  { eArgTypeExpression, "expr", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." },
1060  { eArgTypeExprFormat, "expression-format", CommandCompletions::eNoCompletion, { nullptr, false }, "[ [bool|b] | [bin] | [char|c] | [oct|o] | [dec|i|d|u] | [hex|x] | [float|f] | [cstr|s] ]" },
1061  { eArgTypeFilename, "filename", CommandCompletions::eDiskFileCompletion, { nullptr, false }, "The name of a file (can include path)." },
1062  { eArgTypeFormat, "format", CommandCompletions::eNoCompletion, { FormatHelpTextCallback, true }, nullptr },
1063  { eArgTypeFrameIndex, "frame-index", CommandCompletions::eFrameIndexCompletion, { nullptr, false }, "Index into a thread's list of frames." },
1064  { eArgTypeFullName, "fullname", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." },
1065  { eArgTypeFunctionName, "function-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a function." },
1066  { eArgTypeFunctionOrSymbol, "function-or-symbol", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a function or symbol." },
1067  { eArgTypeGDBFormat, "gdb-format", CommandCompletions::eNoCompletion, { GDBFormatHelpTextCallback, true }, nullptr },
1068  { eArgTypeHelpText, "help-text", CommandCompletions::eNoCompletion, { nullptr, false }, "Text to be used as help for some other entity in LLDB" },
1069  { eArgTypeIndex, "index", CommandCompletions::eNoCompletion, { nullptr, false }, "An index into a list." },
1071  { eArgTypeLineNum, "linenum", CommandCompletions::eNoCompletion, { nullptr, false }, "Line number in a source file." },
1072  { eArgTypeFileLineColumn, "linespec", CommandCompletions::eNoCompletion, { nullptr, false }, "A source specifier in the form file:line[:column]" },
1073  { 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." },
1074  { 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)." },
1075  { eArgTypeMethod, "method", CommandCompletions::eNoCompletion, { nullptr, false }, "A C++ method name." },
1076  { eArgTypeName, "name", CommandCompletions::eTypeCategoryNameCompletion, { nullptr, false }, "Help text goes here." },
1077  { eArgTypeNewPathPrefix, "new-path-prefix", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." },
1078  { eArgTypeNumLines, "num-lines", CommandCompletions::eNoCompletion, { nullptr, false }, "The number of lines to use." },
1079  { eArgTypeNumberPerLine, "number-per-line", CommandCompletions::eNoCompletion, { nullptr, false }, "The number of items per line to display." },
1080  { eArgTypeOffset, "offset", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." },
1081  { eArgTypeOldPathPrefix, "old-path-prefix", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." },
1082  { eArgTypeOneLiner, "one-line-command", CommandCompletions::eNoCompletion, { nullptr, false }, "A command that is entered as a single line of text." },
1083  { eArgTypePath, "path", CommandCompletions::eDiskFileCompletion, { nullptr, false }, "Path." },
1084  { eArgTypePermissionsNumber, "perms-numeric", CommandCompletions::eNoCompletion, { nullptr, false }, "Permissions given as an octal number (e.g. 755)." },
1085  { eArgTypePermissionsString, "perms=string", CommandCompletions::eNoCompletion, { nullptr, false }, "Permissions given as a string value (e.g. rw-r-xr--)." },
1086  { eArgTypePid, "pid", CommandCompletions::eProcessIDCompletion, { nullptr, false }, "The process ID number." },
1087  { eArgTypePlugin, "plugin", CommandCompletions::eProcessPluginCompletion, { nullptr, false }, "Help text goes here." },
1088  { eArgTypeProcessName, "process-name", CommandCompletions::eProcessNameCompletion, { nullptr, false }, "The name of the process." },
1089  { eArgTypePythonClass, "python-class", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a Python class." },
1090  { eArgTypePythonFunction, "python-function", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a Python function." },
1091  { eArgTypePythonScript, "python-script", CommandCompletions::eNoCompletion, { nullptr, false }, "Source code written in Python." },
1092  { eArgTypeQueueName, "queue-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of the thread queue." },
1094  { eArgTypeRegularExpression, "regular-expression", CommandCompletions::eNoCompletion, { nullptr, false }, "A POSIX-compliant extended regular expression." },
1095  { eArgTypeRunArgs, "run-args", CommandCompletions::eNoCompletion, { nullptr, false }, "Arguments to be passed to the target program when it starts executing." },
1096  { eArgTypeRunMode, "run-mode", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." },
1097  { eArgTypeScriptedCommandSynchronicity, "script-cmd-synchronicity", CommandCompletions::eNoCompletion, { nullptr, false }, "The synchronicity to use to run scripted commands with regard to LLDB event system." },
1098  { eArgTypeScriptLang, "script-language", CommandCompletions::eNoCompletion, { nullptr, false }, "The scripting language to be used for script-based commands. Supported languages are python and lua." },
1099  { eArgTypeSearchWord, "search-word", CommandCompletions::eNoCompletion, { nullptr, false }, "Any word of interest for search purposes." },
1100  { eArgTypeSelector, "selector", CommandCompletions::eNoCompletion, { nullptr, false }, "An Objective-C selector name." },
1101  { 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)." },
1102  { 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)." },
1103  { eArgTypeSettingPrefix, "setting-prefix", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a settable internal debugger variable up to a dot ('.'), e.g. 'target.process.'" },
1104  { 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." },
1105  { eArgTypeShlibName, "shlib-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a shared library." },
1106  { eArgTypeSourceFile, "source-file", CommandCompletions::eSourceFileCompletion, { nullptr, false }, "The name of a source file.." },
1107  { eArgTypeSortOrder, "sort-order", CommandCompletions::eNoCompletion, { nullptr, false }, "Specify a sort order when dumping lists." },
1108  { eArgTypeStartAddress, "start-address", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." },
1110  { eArgTypeSymbol, "symbol", CommandCompletions::eSymbolCompletion, { nullptr, false }, "Any symbol name (function name, variable, argument, etc.)" },
1111  { eArgTypeThreadID, "thread-id", CommandCompletions::eNoCompletion, { nullptr, false }, "Thread ID number." },
1112  { eArgTypeThreadIndex, "thread-index", CommandCompletions::eNoCompletion, { nullptr, false }, "Index into the process' list of threads." },
1113  { eArgTypeThreadName, "thread-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The thread's name." },
1114  { eArgTypeTypeName, "type-name", CommandCompletions::eNoCompletion, { nullptr, false }, "A type name." },
1115  { eArgTypeUnsignedInteger, "unsigned-integer", CommandCompletions::eNoCompletion, { nullptr, false }, "An unsigned integer." },
1116  { eArgTypeUnixSignal, "unix-signal", CommandCompletions::eNoCompletion, { nullptr, false }, "A valid Unix signal name or number (e.g. SIGKILL, KILL or 9)." },
1117  { eArgTypeVarName, "variable-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a variable in your program." },
1118  { eArgTypeValue, "value", CommandCompletions::eNoCompletion, { nullptr, false }, "A value could be anything, depending on where and how it is used." },
1119  { eArgTypeWidth, "width", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." },
1120  { eArgTypeNone, "none", CommandCompletions::eNoCompletion, { nullptr, false }, "No help available for this." },
1121  { 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." },
1122  { eArgTypeWatchpointID, "watchpt-id", CommandCompletions::eNoCompletion, { nullptr, false }, "Watchpoint IDs are positive integers." },
1123  { eArgTypeWatchpointIDRange, "watchpt-id-list", CommandCompletions::eNoCompletion, { nullptr, false }, "For example, '1-3' or '1 to 3'." },
1124  { eArgTypeWatchType, "watch-type", CommandCompletions::eNoCompletion, { nullptr, false }, "Specify the type for a watchpoint." },
1125  { 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." },
1126  { eArgTypeCommand, "command", CommandCompletions::eNoCompletion, { nullptr, false }, "An LLDB Command line command element." },
1127  { eArgTypeColumnNum, "column", CommandCompletions::eNoCompletion, { nullptr, false }, "Column number in a source file." },
1128  { eArgTypeModuleUUID, "module-uuid", CommandCompletions::eModuleUUIDCompletion, { nullptr, false }, "A module UUID value." },
1129  { eArgTypeSaveCoreStyle, "corefile-style", CommandCompletions::eNoCompletion, { nullptr, false }, "The type of corefile that lldb will try to create, dependant on this target's capabilities." }
1130  // clang-format on
1131 };
1132 
1134  // If this assertion fires, then the table above is out of date with the
1135  // CommandArgumentType enumeration
1136  static_assert((sizeof(CommandObject::g_arguments_data) /
1138  "");
1140 }
lldb::eArgTypeThreadID
@ eArgTypeThreadID
Definition: lldb-enumerations.h:586
lldb::eArgTypeRegisterName
@ eArgTypeRegisterName
Definition: lldb-enumerations.h:568
lldb_private::CommandObject::GetSelectedOrDummyTarget
Target & GetSelectedOrDummyTarget(bool prefer_dummy=false)
Definition: CommandObject.cpp:941
lldb_private::eArgRepeatOptional
@ eArgRepeatOptional
Definition: lldb-private-enumerations.h:96
lldb::eArgTypeColumnNum
@ eArgTypeColumnNum
Definition: lldb-enumerations.h:602
lldb::eArgTypeThreadIndex
@ eArgTypeThreadIndex
Definition: lldb-enumerations.h:587
lldb_private::CommandCompletions::ePlatformPluginCompletion
@ ePlatformPluginCompletion
Definition: CommandCompletions.h:35
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::eArgRepeatPairRangeOptional
@ eArgRepeatPairRangeOptional
Definition: lldb-private-enumerations.h:106
lldb_private::Args::ReplaceArgumentAtIndex
void ReplaceArgumentAtIndex(size_t idx, llvm::StringRef arg_str, char quote_char='\0')
Replaces the argument value at index idx to arg_str if idx is a valid argument index.
Definition: Args.cpp:333
lldb::eArgTypeSettingKey
@ eArgTypeSettingKey
Definition: lldb-enumerations.h:577
GDBFormatHelpTextCallback
static llvm::StringRef GDBFormatHelpTextCallback()
Definition: CommandObject.cpp:636
lldb_private::CommandObject::GetFormattedCommandArguments
void GetFormattedCommandArguments(Stream &str, uint32_t opt_set_mask=LLDB_OPT_SET_ALL)
Definition: CommandObject.cpp:447
lldb::eArgTypeAddress
@ eArgTypeAddress
Definition: lldb-enumerations.h:516
BreakpointIDRangeHelpTextCallback
static llvm::StringRef BreakpointIDRangeHelpTextCallback()
Definition: CommandObject.cpp:592
lldb_private::CommandObject::GetDummyTarget
Target & GetDummyTarget()
Definition: CommandObject.cpp:937
lldb_private::ExecutionContext::HasTargetScope
bool HasTargetScope() const
Returns true the ExecutionContext object contains a valid target.
Definition: ExecutionContext.cpp:381
lldb::eArgTypeExprFormat
@ eArgTypeExprFormat
Definition: lldb-enumerations.h:535
lldb_private::CommandObject::m_cmd_help_short
std::string m_cmd_help_short
Definition: CommandObject.h:377
lldb_private::eArgRepeatPlain
@ eArgRepeatPlain
Definition: lldb-private-enumerations.h:95
lldb::Format
Format
Display format definitions.
Definition: lldb-enumerations.h:155
ExprPathHelpTextCallback
static llvm::StringRef ExprPathHelpTextCallback()
Definition: CommandObject.cpp:793
lldb_private::Flags::AnySet
bool AnySet(ValueType mask) const
Test one or more flags.
Definition: Flags.h:90
lldb::eArgTypeHelpText
@ eArgTypeHelpText
Definition: lldb-enumerations.h:544
lldb_private::CommandCompletions::eProcessPluginCompletion
@ eProcessPluginCompletion
Definition: CommandCompletions.h:40
lldb_private::CommandObjectRaw::Execute
bool Execute(const char *args_string, CommandReturnObject &result) override
Definition: CommandObject.cpp:1007
lldb::eArgTypeSummaryString
@ eArgTypeSummaryString
Definition: lldb-enumerations.h:584
lldb_private::ExecutionContext::GetProcessPtr
Process * GetProcessPtr() const
Returns a pointer to the process object.
Definition: ExecutionContext.cpp:208
lldb::eArgTypeQueueName
@ eArgTypeQueueName
Definition: lldb-enumerations.h:567
lldb_private::CompletionRequest::GetParsedLine
const Args & GetParsedLine() const
Definition: CompletionRequest.h:134
lldb_private::CommandObject::ArgumentTableEntry::help_function
ArgumentHelpCallback help_function
Definition: CommandObject.h:85
lldb_private::Options::NotifyOptionParsingStarting
void NotifyOptionParsingStarting(ExecutionContext *execution_context)
Definition: Options.cpp:32
lldb::eArgTypeRunMode
@ eArgTypeRunMode
Definition: lldb-enumerations.h:571
lldb_private::CommandObject::ParseOptions
bool ParseOptions(Args &args, CommandReturnObject &result)
Definition: CommandObject.cpp:104
lldb::eStateAttaching
@ eStateAttaching
Process is currently trying to attach.
Definition: lldb-enumerations.h:78
lldb_private::Debugger::GetDummyTarget
Target & GetDummyTarget()
Definition: Debugger.h:390
FormatManager.h
lldb_private::CommandObject::HelpTextContainsWord
bool HelpTextContainsWord(llvm::StringRef search_word, bool search_short_help=true, bool search_long_help=true, bool search_syntax=true, bool search_options=true)
Definition: CommandObject.cpp:306
lldb_private::FormatManager::GetFormatAsFormatChar
static char GetFormatAsFormatChar(lldb::Format format)
Definition: FormatManager.cpp:144
lldb_private::CommandObject::m_exe_ctx
ExecutionContext m_exe_ctx
Definition: CommandObject.h:374
lldb::eArgTypeWatchpointIDRange
@ eArgTypeWatchpointIDRange
Definition: lldb-enumerations.h:598
lldb_private::CommandObject::ArgumentTableEntry::help_text
const char * help_text
Definition: CommandObject.h:86
lldb_private::CommandObject::GetHelpLong
virtual llvm::StringRef GetHelpLong()
Definition: CommandObject.cpp:55
lldb_private::ArchSpec::ListSupportedArchNames
static void ListSupportedArchNames(StringList &list)
Definition: ArchSpec.cpp:256
lldb_private::CommandObject::IsDashDashCommand
virtual bool IsDashDashCommand()
Definition: CommandObject.h:159
lldb_private::Args::AppendArguments
void AppendArguments(const Args &rhs)
Definition: Args.cpp:293
lldb_private::Process
Definition: Process.h:341
lldb_private::CommandCompletions::eModuleUUIDCompletion
@ eModuleUUIDCompletion
Definition: CommandCompletions.h:44
lldb_private::OptionGroupOptions
Definition: Options.h:255
lldb_private::Process::GetThreadList
ThreadList & GetThreadList()
Definition: Process.h:2078
lldb::eArgTypeBreakpointName
@ eArgTypeBreakpointName
Definition: lldb-enumerations.h:524
lldb::eArgTypeAliasOptions
@ eArgTypeAliasOptions
Definition: lldb-enumerations.h:519
lldb_private::CommandObject::CommandArgumentData
Definition: CommandObject.h:89
lldb::eArgTypeCommand
@ eArgTypeCommand
Definition: lldb-enumerations.h:601
lldb::eArgTypeAddressOrExpression
@ eArgTypeAddressOrExpression
Definition: lldb-enumerations.h:517
lldb::eArgTypeLogChannel
@ eArgTypeLogChannel
Definition: lldb-enumerations.h:549
lldb::eArgTypeCommandName
@ eArgTypeCommandName
Definition: lldb-enumerations.h:527
lldb_private::CommandCompletions::eProcessNameCompletion
@ eProcessNameCompletion
Definition: CommandCompletions.h:50
lldb::eArgTypeOldPathPrefix
@ eArgTypeOldPathPrefix
Definition: lldb-enumerations.h:556
lldb_private::CommandObject::FormatLongHelpText
void FormatLongHelpText(Stream &output_strm, llvm::StringRef long_help)
Definition: CommandObject.cpp:828
lldb_private::CommandObject::g_arguments_data
static ArgumentTableEntry g_arguments_data[lldb::eArgTypeLastArg]
Definition: CommandObject.h:108
lldb::eArgTypeExpression
@ eArgTypeExpression
Definition: lldb-enumerations.h:533
lldb_private::CommandInterpreter::OutputHelpText
void OutputHelpText(Stream &stream, llvm::StringRef command_word, llvm::StringRef separator, llvm::StringRef help_text, uint32_t max_word_len)
lldb_private::ExecutionContext::GetFramePtr
StackFrame * GetFramePtr() const
Returns a pointer to the frame object.
Definition: ExecutionContext.h:408
lldb::eArgTypeDescriptionVerbosity
@ eArgTypeDescriptionVerbosity
Definition: lldb-enumerations.h:529
lldb::eArgTypeFilename
@ eArgTypeFilename
Definition: lldb-enumerations.h:537
lldb::eArgTypeRunArgs
@ eArgTypeRunArgs
Definition: lldb-enumerations.h:570
lldb::eArgTypeProcessName
@ eArgTypeProcessName
Definition: lldb-enumerations.h:563
lldb_private::CommandObject::SetHelpLong
virtual void SetHelpLong(llvm::StringRef str)
Definition: CommandObject.cpp:90
lldb_private::CommandObject::CommandArgumentData::arg_repetition
ArgumentRepetitionType arg_repetition
Definition: CommandObject.h:92
lldb::eArgTypeSettingPrefix
@ eArgTypeSettingPrefix
Definition: lldb-enumerations.h:578
lldb_private::CommandCompletions::eProcessIDCompletion
@ eProcessIDCompletion
Definition: CommandCompletions.h:49
lldb::eArgTypeValue
@ eArgTypeValue
Definition: lldb-enumerations.h:593
lldb::eArgTypeScriptLang
@ eArgTypeScriptLang
Definition: lldb-enumerations.h:573
lldb_private::Stream
Definition: Stream.h:28
lldb_private::Args
Definition: Args.h:33
lldb::eArgTypePythonFunction
@ eArgTypePythonFunction
Definition: lldb-enumerations.h:565
Language.h
lldb_private::CommandObject::SetHelp
virtual void SetHelp(llvm::StringRef str)
Definition: CommandObject.cpp:86
lldb::eArgTypeTypeName
@ eArgTypeTypeName
Definition: lldb-enumerations.h:589
lldb::eArgTypeLineNum
@ eArgTypeLineNum
Definition: lldb-enumerations.h:547
arch_helper
static llvm::StringRef arch_helper()
Definition: CommandObject.cpp:1027
lldb_private::eArgRepeatPlus
@ eArgRepeatPlus
Definition: lldb-private-enumerations.h:97
lldb_private::CommandObject::ParseOptionsAndNotify
bool ParseOptionsAndNotify(Args &args, CommandReturnObject &result, OptionGroupOptions &group_options, ExecutionContext &exe_ctx)
Definition: CommandObject.cpp:341
lldb_private::CommandInterpreter::ProcessEmbeddedScriptCommands
const char * ProcessEmbeddedScriptCommands(const char *arg)
Definition: CommandInterpreter.cpp:484
CommandReturnObject.h
lldb_private::CommandCompletions::eTypeCategoryNameCompletion
@ eTypeCategoryNameCompletion
Definition: CommandCompletions.h:53
lldb_private::Target
Definition: Target.h:451
lldb::eArgTypePath
@ eArgTypePath
Definition: lldb-enumerations.h:558
lldb_private::ExecutionContext::GetThreadPtr
Thread * GetThreadPtr() const
Returns a pointer to the thread object.
Definition: ExecutionContext.h:399
lldb::eArgTypeArchitecture
@ eArgTypeArchitecture
Definition: lldb-enumerations.h:520
lldb_private::StreamString::GetString
llvm::StringRef GetString() const
Definition: StreamString.cpp:51
lldb_private::Process::GetState
lldb::StateType GetState()
Get accessor for the current process state.
Definition: Process.cpp:1294
lldb::eStateExited
@ eStateExited
Process has exited and can't be examined.
Definition: lldb-enumerations.h:90
lldb_private::eArgRepeatPairOptional
@ eArgRepeatPairOptional
Definition: lldb-private-enumerations.h:102
Process.h
lldb::eReturnStatusSuccessFinishNoResult
@ eReturnStatusSuccessFinishNoResult
Definition: lldb-enumerations.h:260
lldb_private::CommandObject::CheckRequirements
bool CheckRequirements(CommandReturnObject &result)
Check the command to make sure anything required by this command is available.
Definition: CommandObject.cpp:145
lldb_private::CommandObject::ArgumentHelpCallback::self_formatting
bool self_formatting
Definition: CommandObject.h:73
lldb::eStateStopped
@ eStateStopped
Process or thread is stopped and can be examined.
Definition: lldb-enumerations.h:84
lldb_private::CommandCompletions::eFrameIndexCompletion
@ eFrameIndexCompletion
Definition: CommandCompletions.h:43
Target.h
lldb_private::CommandObject::m_arguments
std::vector< CommandArgumentEntry > m_arguments
Definition: CommandObject.h:381
lldb_private::Language::PrintAllLanguages
static void PrintAllLanguages(Stream &s, const char *prefix, const char *suffix)
Definition: Language.cpp:224
lldb::eArgTypeVarName
@ eArgTypeVarName
Definition: lldb-enumerations.h:592
BreakpointIDHelpTextCallback
static llvm::StringRef BreakpointIDHelpTextCallback()
Definition: CommandObject.cpp:573
lldb::eArgTypeThreadName
@ eArgTypeThreadName
Definition: lldb-enumerations.h:588
lldb_private::CommandObject::GetArgumentHelp
static void GetArgumentHelp(Stream &str, lldb::CommandArgumentType arg_type, CommandInterpreter &interpreter)
Definition: CommandObject.cpp:377
lldb_private::ExecutionContext::Clear
void Clear()
Clear the object's state.
Definition: ExecutionContext.cpp:167
lldb::eArgTypeShlibName
@ eArgTypeShlibName
Definition: lldb-enumerations.h:580
lldb_private::CommandObject::HasOverrideCallback
bool HasOverrideCallback() const
Definition: CommandObject.h:294
lldb::eArgTypeByteSize
@ eArgTypeByteSize
Definition: lldb-enumerations.h:525
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
Options.h
lldb::eArgTypeDisassemblyFlavor
@ eArgTypeDisassemblyFlavor
Definition: lldb-enumerations.h:531
lldb_private::StreamString::GetSize
size_t GetSize() const
Definition: StreamString.cpp:38
lldb::eArgTypeFunctionName
@ eArgTypeFunctionName
Definition: lldb-enumerations.h:541
lldb::eArgTypeNumberPerLine
@ eArgTypeNumberPerLine
Definition: lldb-enumerations.h:554
lldb::eStateCrashed
@ eStateCrashed
Process or thread has crashed and can be examined.
Definition: lldb-enumerations.h:88
lldb_private::ExecutionContext::GetRegisterContext
RegisterContext * GetRegisterContext() const
Definition: ExecutionContext.cpp:192
lldb_private::CommandObject::GetInvalidTargetDescription
virtual const char * GetInvalidTargetDescription()
Definition: CommandObject.h:330
lldb_private::Options
Definition: Options.h:57
lldb_private::CommandCompletions::eSourceFileCompletion
@ eSourceFileCompletion
Definition: CommandCompletions.h:29
ID
static char ID
Definition: IRDynamicChecks.cpp:32
lldb::CommandArgumentType
CommandArgumentType
Definition: lldb-enumerations.h:515
lldb_private::CommandObject::GetSyntax
virtual llvm::StringRef GetSyntax()
Definition: CommandObject.cpp:57
lldb_private::CommandObject::GetInvalidFrameDescription
virtual const char * GetInvalidFrameDescription()
Definition: CommandObject.h:340
lldb::eArgTypeCount
@ eArgTypeCount
Definition: lldb-enumerations.h:528
lldb::eArgTypeLastArg
@ eArgTypeLastArg
Definition: lldb-enumerations.h:605
lldb_private::CommandObject::GetNumArgumentEntries
int GetNumArgumentEntries()
Definition: CommandObject.cpp:356
lldb_private::Target::GetAPIMutex
std::recursive_mutex & GetAPIMutex()
Definition: Target.cpp:4511
lldb_private::FormatManager::GetFormatAsCString
static const char * GetFormatAsCString(lldb::Format format)
Definition: FormatManager.cpp:152
lldb_private::eArgRepeatPairPlain
@ eArgRepeatPairPlain
Definition: lldb-private-enumerations.h:100
lldb::eArgTypeSourceFile
@ eArgTypeSourceFile
Definition: lldb-enumerations.h:581
lldb_private::Options::VerifyOptions
bool VerifyOptions(CommandReturnObject &result)
Definition: Options.cpp:105
lldb_private::Thread
Definition: Thread.h:60
lldb::eArgTypePythonClass
@ eArgTypePythonClass
Definition: lldb-enumerations.h:564
lldb_private::CommandReturnObject::SetStatus
void SetStatus(lldb::ReturnStatus status)
Definition: CommandReturnObject.cpp:121
lldb::eStateConnected
@ eStateConnected
Process is connected to remote debug services, but not launched or attached to anything yet.
Definition: lldb-enumerations.h:76
lldb::eArgTypeIndex
@ eArgTypeIndex
Definition: lldb-enumerations.h:545
lldb::eArgTypeBreakpointID
@ eArgTypeBreakpointID
Definition: lldb-enumerations.h:522
lldb_private::CommandObject::GetInvalidRegContextDescription
virtual const char * GetInvalidRegContextDescription()
Definition: CommandObject.h:342
lldb_private::eArgRepeatRange
@ eArgRepeatRange
Definition: lldb-private-enumerations.h:99
lldb::eStateLaunching
@ eStateLaunching
Process is in the process of launching.
Definition: lldb-enumerations.h:79
lldb_private::CommandCompletions::eNoCompletion
@ eNoCompletion
Definition: CommandCompletions.h:28
lldb::eArgTypeEndAddress
@ eArgTypeEndAddress
Definition: lldb-enumerations.h:532
lldb_private::CommandObject::IsPairType
bool IsPairType(ArgumentRepetitionType arg_repeat_type)
Definition: CommandObject.cpp:424
lldb_private::CommandReturnObject::GetOutputStream
Stream & GetOutputStream()
Definition: CommandReturnObject.h:45
lldb_private::CommandObject::SetCommandName
void SetCommandName(llvm::StringRef name)
Definition: CommandObject.cpp:82
lldb::eArgTypePlatform
@ eArgTypePlatform
Definition: lldb-enumerations.h:596
lldb_private::eArgRepeatPairPlus
@ eArgRepeatPairPlus
Definition: lldb-private-enumerations.h:103
LLDB_OPT_SET_ALL
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:112
lldb_private::CommandObject::GetArgumentName
static const char * GetArgumentName(lldb::CommandArgumentType arg_type)
Definition: CommandObject.cpp:408
lldb_private::CommandObject::GetArgumentTable
static const ArgumentTableEntry * GetArgumentTable()
Definition: CommandObject.cpp:1133
lldb_private::StringList
Definition: StringList.h:25
FileSpecList.h
lldb::eArgTypeFrameIndex
@ eArgTypeFrameIndex
Definition: lldb-enumerations.h:539
lldb_private::StreamString
Definition: StreamString.h:23
lldb_private::CommandObject::HandleArgumentCompletion
virtual void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector)
The input array contains a parsed version of the line.
Definition: CommandObject.h:257
lldb_private::Args::entries
llvm::ArrayRef< ArgEntry > entries() const
Definition: Args.h:130
lldb_private::CommandObject::GetCommandName
llvm::StringRef GetCommandName() const
Definition: CommandObject.cpp:80
lldb_private::CommandObject::ArgumentTableEntry::arg_type
lldb::CommandArgumentType arg_type
Definition: CommandObject.h:82
lldb::eArgTypeAliasName
@ eArgTypeAliasName
Definition: lldb-enumerations.h:518
lldb_private::CommandObject::GetOptions
virtual Options * GetOptions()
Definition: CommandObject.cpp:98
lldb::eArgTypeNumLines
@ eArgTypeNumLines
Definition: lldb-enumerations.h:553
lldb::eArgTypeRegularExpression
@ eArgTypeRegularExpression
Definition: lldb-enumerations.h:569
lldb_private::ExecutionContext::HasFrameScope
bool HasFrameScope() const
Returns true the ExecutionContext object contains a valid target, process, thread and frame.
Definition: ExecutionContext.cpp:393
lldb_private::CommandInterpreter
Definition: CommandInterpreter.h:214
lldb_private::eArgRepeatStar
@ eArgRepeatStar
Definition: lldb-private-enumerations.h:98
lldb::eStateDetached
@ eStateDetached
Process has been detached and can't be examined.
Definition: lldb-enumerations.h:89
lldb::eReturnStatusFailed
@ eReturnStatusFailed
Definition: lldb-enumerations.h:265
RegisterNameHelpTextCallback
static llvm::StringRef RegisterNameHelpTextCallback()
Definition: CommandObject.cpp:555
lldb_private::Debugger
Definition: Debugger.h:70
lldb::eArgTypeSymbol
@ eArgTypeSymbol
Definition: lldb-enumerations.h:585
lldb_private::StreamString::Empty
bool Empty() const
Definition: StreamString.cpp:36
lldb_private::CommandObject::m_interpreter
CommandInterpreter & m_interpreter
Definition: CommandObject.h:373
lldb_private::CommandObject::GetDefaultThread
Thread * GetDefaultThread()
Definition: CommandObject.cpp:954
lldb::eArgTypeUnixSignal
@ eArgTypeUnixSignal
Definition: lldb-enumerations.h:591
lldb_private::CommandObject::CommandArgumentData::arg_type
lldb::CommandArgumentType arg_type
Definition: CommandObject.h:91
lldb_private::Options::Parse
llvm::Expected< Args > Parse(const Args &args, ExecutionContext *execution_context, lldb::PlatformSP platform_sp, bool require_validation)
Parse the provided arguments.
Definition: Options.cpp:1286
lldb_private::OptionElementVector
std::vector< OptionArgElement > OptionElementVector
Definition: Options.h:42
lldb_private::CommandReturnObject::GetErrorStream
Stream & GetErrorStream()
Definition: CommandReturnObject.h:55
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb::kNumFormats
@ kNumFormats
Definition: lldb-enumerations.h:202
lldb::eArgTypeWidth
@ eArgTypeWidth
Definition: lldb-enumerations.h:594
lldb_private::CommandObject::GetSelectedTarget
Target & GetSelectedTarget()
Definition: CommandObject.cpp:945
lldb::eArgTypeGDBFormat
@ eArgTypeGDBFormat
Definition: lldb-enumerations.h:543
lldb_private::Stream::PutChar
size_t PutChar(char ch)
Definition: Stream.cpp:104
lldb::eArgTypeStartAddress
@ eArgTypeStartAddress
Definition: lldb-enumerations.h:583
lldb::eStateUnloaded
@ eStateUnloaded
Process is object is valid, but not currently loaded.
Definition: lldb-enumerations.h:75
lldb_private::CommandObject::GetInvalidProcessDescription
virtual const char * GetInvalidProcessDescription()
Definition: CommandObject.h:334
Address.h
lldb::eArgTypeOneLiner
@ eArgTypeOneLiner
Definition: lldb-enumerations.h:557
SummaryStringHelpTextCallback
static llvm::StringRef SummaryStringHelpTextCallback()
Definition: CommandObject.cpp:718
lldb_private::ExecutionContext::HasThreadScope
bool HasThreadScope() const
Returns true the ExecutionContext object contains a valid target, process, and thread.
Definition: ExecutionContext.cpp:389
lldb_private::eArgRepeatPairRange
@ eArgRepeatPairRange
Definition: lldb-private-enumerations.h:105
lldb::eArgTypePermissionsNumber
@ eArgTypePermissionsNumber
Definition: lldb-enumerations.h:559
lldb_private::Options::GenerateOptionUsage
void GenerateOptionUsage(Stream &strm, CommandObject *cmd, uint32_t screen_width)
Definition: Options.cpp:390
lldb::eArgTypeSaveCoreStyle
@ eArgTypeSaveCoreStyle
Definition: lldb-enumerations.h:604
lldb_private::CommandCompletions::eDiskDirectoryCompletion
@ eDiskDirectoryCompletion
Definition: CommandCompletions.h:31
lldb::eStateStepping
@ eStateStepping
Process or thread is in the process of stepping and can not be examined.
Definition: lldb-enumerations.h:86
lldb::eArgTypeSelector
@ eArgTypeSelector
Definition: lldb-enumerations.h:575
lldb_private::ArgumentRepetitionType
ArgumentRepetitionType
Definition: lldb-private-enumerations.h:94
lldb::eArgTypePythonScript
@ eArgTypePythonScript
Definition: lldb-enumerations.h:566
lldb_private::Target::GetProcessSP
const lldb::ProcessSP & GetProcessSP() const
Definition: Target.cpp:211
lldb_private::CommandObjectRaw::DoExecute
virtual bool DoExecute(llvm::StringRef command, CommandReturnObject &result)=0
lldb::eStateSuspended
@ eStateSuspended
Process or thread is in a suspended state as far as the debugger is concerned while other processes o...
Definition: lldb-enumerations.h:91
lldb_private::CommandCompletions::eDisassemblyFlavorCompletion
@ eDisassemblyFlavorCompletion
Definition: CommandCompletions.h:41
lldb::eArgTypePlugin
@ eArgTypePlugin
Definition: lldb-enumerations.h:562
lldb::eArgTypeLanguage
@ eArgTypeLanguage
Definition: lldb-enumerations.h:546
lldb_private::CommandObject::LookupArgumentName
static lldb::CommandArgumentType LookupArgumentName(llvm::StringRef arg_name)
Definition: CommandObject.cpp:542
lldb_private::Status
Definition: Status.h:44
lldb_private::Options::ParseForCompletion
OptionElementVector ParseForCompletion(const Args &args, uint32_t cursor_index)
Definition: Options.cpp:1099
lldb_private::CommandCompletions::eBreakpointNameCompletion
@ eBreakpointNameCompletion
Definition: CommandCompletions.h:48
lldb_private::CommandReturnObject
Definition: CommandReturnObject.h:25
lldb_private::CommandObject::AddIDsArgumentData
static void AddIDsArgumentData(CommandArgumentEntry &arg, lldb::CommandArgumentType ID, lldb::CommandArgumentType IDRange)
Definition: CommandObject.cpp:900
uint32_t
lldb_private::CommandObject::GetFlags
Flags & GetFlags()
The flags accessor.
Definition: CommandObject.h:270
lldb::eArgTypeFunctionOrSymbol
@ eArgTypeFunctionOrSymbol
Definition: lldb-enumerations.h:542
lldb::eArgTypePid
@ eArgTypePid
Definition: lldb-enumerations.h:561
lldb_private::CommandInterpreter::GetDebugger
Debugger & GetDebugger()
Definition: CommandInterpreter.h:436
lldb_private::CommandObject::m_cmd_name
std::string m_cmd_name
Definition: CommandObject.h:376
lldb_private::Flags::Get
ValueType Get() const
Get accessor for all flags.
Definition: Flags.h:40
CommandObject.h
BreakpointNameHelpTextCallback
static llvm::StringRef BreakpointNameHelpTextCallback()
Definition: CommandObject.cpp:611
lldb::eArgTypeWatchpointID
@ eArgTypeWatchpointID
Definition: lldb-enumerations.h:597
lldb_private::Args::GetConstArgumentVector
const char ** GetConstArgumentVector() const
Gets the argument vector.
Definition: Args.cpp:275
lldb::eArgTypeNone
@ eArgTypeNone
Definition: lldb-enumerations.h:595
lldb_private::CommandObject::HandleCompletion
virtual void HandleCompletion(CompletionRequest &request)
This default version handles calling option argument completions and then calls HandleArgumentComplet...
Definition: CommandObject.cpp:273
lldb::eArgTypeMethod
@ eArgTypeMethod
Definition: lldb-enumerations.h:550
lldb::eArgTypeName
@ eArgTypeName
Definition: lldb-enumerations.h:551
lldb::eArgTypeModuleUUID
@ eArgTypeModuleUUID
Definition: lldb-enumerations.h:603
lldb::eArgTypeBreakpointIDRange
@ eArgTypeBreakpointIDRange
Definition: lldb-enumerations.h:523
LanguageTypeHelpTextCallback
static llvm::StringRef LanguageTypeHelpTextCallback()
Definition: CommandObject.cpp:700
ArchSpec.h
lldb::eArgTypeWatchType
@ eArgTypeWatchType
Definition: lldb-enumerations.h:599
lldb_private::CommandObject::m_api_locker
std::unique_lock< std::recursive_mutex > m_api_locker
Definition: CommandObject.h:375
lldb::eArgTypeSearchWord
@ eArgTypeSearchWord
Definition: lldb-enumerations.h:574
lldb::eArgTypeUnsignedInteger
@ eArgTypeUnsignedInteger
Definition: lldb-enumerations.h:590
lldb_private::CommandObject::SetSyntax
void SetSyntax(llvm::StringRef str)
Definition: CommandObject.cpp:94
lldb::eArgTypeScriptedCommandSynchronicity
@ eArgTypeScriptedCommandSynchronicity
Definition: lldb-enumerations.h:572
lldb_private::CommandObject::FindArgumentDataByType
static const ArgumentTableEntry * FindArgumentDataByType(lldb::CommandArgumentType arg_type)
Definition: CommandObject.cpp:367
FormatHelpTextCallback
static llvm::StringRef FormatHelpTextCallback()
Definition: CommandObject.cpp:673
lldb::eArgTypeFullName
@ eArgTypeFullName
Definition: lldb-enumerations.h:540
lldb_private::CommandObject::ArgumentTableEntry
Definition: CommandObject.h:80
lldb::eArgTypeBoolean
@ eArgTypeBoolean
Definition: lldb-enumerations.h:521
lldb::eArgTypeLogCategory
@ eArgTypeLogCategory
Definition: lldb-enumerations.h:548
lldb::eArgTypeSettingVariableName
@ eArgTypeSettingVariableName
Definition: lldb-enumerations.h:579
lldb_private::CommandObject::GetArgumentEntryAtIndex
CommandArgumentEntry * GetArgumentEntryAtIndex(int idx)
Definition: CommandObject.cpp:359
lldb::eArgTypeSettingIndex
@ eArgTypeSettingIndex
Definition: lldb-enumerations.h:576
lldb_private::CommandObject::GetCommandInterpreter
CommandInterpreter & GetCommandInterpreter()
Definition: CommandObject.h:124
lldb_private::CommandObject::m_cmd_help_long
std::string m_cmd_help_long
Definition: CommandObject.h:378
lldb_private::Stream::Printf
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:107
lldb::eArgTypeFormat
@ eArgTypeFormat
Definition: lldb-enumerations.h:538
lldb_private::Debugger::GetUseColor
bool GetUseColor() const
Definition: Debugger.cpp:352
lldb_private::CommandCompletions::eTypeLanguageCompletion
@ eTypeLanguageCompletion
Definition: CommandCompletions.h:42
lldb::eArgTypeFileLineColumn
@ eArgTypeFileLineColumn
Definition: lldb-enumerations.h:536
lldb::eArgTypeNewPathPrefix
@ eArgTypeNewPathPrefix
Definition: lldb-enumerations.h:552
lldb_private::Options::HandleOptionCompletion
bool HandleOptionCompletion(lldb_private::CompletionRequest &request, OptionElementVector &option_map, CommandInterpreter &interpreter)
Handles the generic bits of figuring out whether we are in an option, and if so completing it.
Definition: Options.cpp:642
lldb_private::CompletionRequest::GetCursorIndex
size_t GetCursorIndex() const
Definition: CompletionRequest.h:156
lldb_private::Options::NumCommandOptions
uint32_t NumCommandOptions()
Definition: Options.cpp:199
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::Debugger::GetSelectedTarget
lldb::TargetSP GetSelectedTarget()
Definition: Debugger.h:216
lldb_private::CommandObjectParsed::Execute
bool Execute(const char *args_string, CommandReturnObject &result) override
Definition: CommandObject.cpp:975
lldb_private::CommandObjectParsed::DoExecute
virtual bool DoExecute(Args &command, CommandReturnObject &result)=0
FileSpec.h
lldb_private::Options::NotifyOptionParsingFinished
Status NotifyOptionParsingFinished(ExecutionContext *execution_context)
Definition: Options.cpp:39
lldb_private::CommandObject::GetInvalidThreadDescription
virtual const char * GetInvalidThreadDescription()
Definition: CommandObject.h:338
lldb::eArgTypeClassName
@ eArgTypeClassName
Definition: lldb-enumerations.h:526
lldb::eStateInvalid
@ eStateInvalid
Definition: lldb-enumerations.h:74
lldb_private::CommandObject::WantsCompletion
virtual bool WantsCompletion()
Definition: CommandObject.h:206
lldb_private::Target::GetTrace
lldb::TraceSP GetTrace()
Get the Trace object containing processor trace information of this target.
Definition: Target.cpp:3137
lldb_private::CommandObject::GetArgumentDescriptionAsCString
static const char * GetArgumentDescriptionAsCString(const lldb::CommandArgumentType arg_type)
Definition: CommandObject.cpp:930
CommandInterpreter.h
lldb_private::StreamString::Flush
void Flush() override
Flush the stream.
Definition: StreamString.cpp:22
lldb_private::CommandInterpreter::GetExecutionContext
ExecutionContext GetExecutionContext() const
lldb_private::CommandObject::ArgumentTableEntry::arg_name
const char * arg_name
Definition: CommandObject.h:83
lldb::StateType
StateType
Process and Thread States.
Definition: lldb-enumerations.h:73
lldb::eArgTypeSortOrder
@ eArgTypeSortOrder
Definition: lldb-enumerations.h:582
lldb_private::Stream::PutCString
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:63
lldb_private::CommandCompletions::eArchitectureCompletion
@ eArchitectureCompletion
Definition: CommandCompletions.h:36
lldb::eArgRawInput
@ eArgRawInput
Definition: lldb-enumerations.h:600
lldb_private::CommandObject::CommandArgumentEntry
std::vector< CommandArgumentData > CommandArgumentEntry
Definition: CommandObject.h:105
lldb_private::CommandInterpreter::OutputFormattedHelpText
void OutputFormattedHelpText(Stream &strm, llvm::StringRef prefix, llvm::StringRef help_text)
lldb_private::CommandObject::Cleanup
void Cleanup()
Definition: CommandObject.cpp:267
lldb_private::CommandObject::GetArgumentTypeAsCString
static const char * GetArgumentTypeAsCString(const lldb::CommandArgumentType arg_type)
Definition: CommandObject.cpp:923
lldb_private::CommandReturnObject::AppendError
void void AppendError(llvm::StringRef in_string)
Definition: CommandReturnObject.cpp:100
lldb_private::ThreadList::GetSelectedThread
lldb::ThreadSP GetSelectedThread()
Definition: ThreadList.cpp:648
lldb::eArgTypeDirectoryName
@ eArgTypeDirectoryName
Definition: lldb-enumerations.h:530
lldb_private::ExecutionContext::HasProcessScope
bool HasProcessScope() const
Returns true the ExecutionContext object contains a valid target and process.
Definition: ExecutionContext.cpp:385
lldb_private::StringList::Join
void Join(const char *separator, Stream &strm)
Definition: StringList.cpp:86
lldb_private::CommandObject::InvokeOverrideCallback
bool InvokeOverrideCallback(const char **argv, CommandReturnObject &result)
Definition: CommandObject.h:311
lldb
Definition: SBAddress.h:15
lldb::eStateRunning
@ eStateRunning
Process or thread is running and can't be examined.
Definition: lldb-enumerations.h:85
lldb::eArgTypeExpressionPath
@ eArgTypeExpressionPath
Definition: lldb-enumerations.h:534
lldb_private::eArgRepeatPairStar
@ eArgRepeatPairStar
Definition: lldb-private-enumerations.h:104
lldb_private::CommandObject::WantsRawCommandString
virtual bool WantsRawCommandString()=0
lldb::eFormatDefault
@ eFormatDefault
Definition: lldb-enumerations.h:156
lldb_private::CommandCompletions::eDiskFileCompletion
@ eDiskFileCompletion
Definition: CommandCompletions.h:30
lldb_private::ExecutionContext::GetTargetPtr
Target * GetTargetPtr() const
Returns a pointer to the target object.
Definition: ExecutionContext.cpp:200
lldb::eArgTypePermissionsString
@ eArgTypePermissionsString
Definition: lldb-enumerations.h:560
lldb_private::CommandObject::m_cmd_syntax
std::string m_cmd_syntax
Definition: CommandObject.h:379
lldb::eArgTypeOffset
@ eArgTypeOffset
Definition: lldb-enumerations.h:555
lldb_private::Debugger::GetSelectedOrDummyTarget
Target & GetSelectedOrDummyTarget(bool prefer_dummy=false)
Definition: Debugger.cpp:1744
lldb_private::CommandObject::GetHelp
virtual llvm::StringRef GetHelp()
Definition: CommandObject.cpp:53
OptSetFiltered
static CommandObject::CommandArgumentEntry OptSetFiltered(uint32_t opt_set_mask, CommandObject::CommandArgumentEntry &cmd_arg_entry)
Definition: CommandObject.cpp:434
lldb_private::CompletionRequest
Definition: CompletionRequest.h:100
lldb_private::CommandObject::GetDebugger
Debugger & GetDebugger()
Definition: CommandObject.cpp:51
lldb_private::CommandObject::m_flags
Flags m_flags
Definition: CommandObject.h:380
lldb_private::CommandCompletions::eSymbolCompletion
@ eSymbolCompletion
Definition: CommandCompletions.h:32
lldb_private::CommandObject::GenerateHelpText
void GenerateHelpText(CommandReturnObject &result)
Definition: CommandObject.cpp:849