LLDB  mainline
CommandObjectMultiword.cpp
Go to the documentation of this file.
1 //===-- CommandObjectMultiword.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 
13 
14 using namespace lldb;
15 using namespace lldb_private;
16 
17 // CommandObjectMultiword
18 
19 CommandObjectMultiword::CommandObjectMultiword(CommandInterpreter &interpreter,
20  const char *name,
21  const char *help,
22  const char *syntax,
23  uint32_t flags)
24  : CommandObject(interpreter, name, help, syntax, flags),
25  m_can_be_removed(false) {}
26 
28 
29 CommandObjectSP CommandObjectMultiword::GetSubcommandSP(llvm::StringRef sub_cmd,
30  StringList *matches) {
31  CommandObjectSP return_cmd_sp;
32  CommandObject::CommandMap::iterator pos;
33 
34  if (!m_subcommand_dict.empty()) {
35  pos = m_subcommand_dict.find(std::string(sub_cmd));
36  if (pos != m_subcommand_dict.end()) {
37  // An exact match; append the sub_cmd to the 'matches' string list.
38  if (matches)
39  matches->AppendString(sub_cmd);
40  return_cmd_sp = pos->second;
41  } else {
42  StringList local_matches;
43  if (matches == nullptr)
44  matches = &local_matches;
45  int num_matches =
47 
48  if (num_matches == 1) {
49  // Cleaner, but slightly less efficient would be to call back into this
50  // function, since I now know I have an exact match...
51 
52  sub_cmd = matches->GetStringAtIndex(0);
53  pos = m_subcommand_dict.find(std::string(sub_cmd));
54  if (pos != m_subcommand_dict.end())
55  return_cmd_sp = pos->second;
56  }
57  }
58  }
59  return return_cmd_sp;
60 }
61 
64  StringList *matches) {
65  return GetSubcommandSP(sub_cmd, matches).get();
66 }
67 
68 bool CommandObjectMultiword::LoadSubCommand(llvm::StringRef name,
69  const CommandObjectSP &cmd_obj) {
70  if (cmd_obj)
71  assert((&GetCommandInterpreter() == &cmd_obj->GetCommandInterpreter()) &&
72  "tried to add a CommandObject from a different interpreter");
73 
74  CommandMap::iterator pos;
75  bool success = true;
76 
77  pos = m_subcommand_dict.find(std::string(name));
78  if (pos == m_subcommand_dict.end()) {
79  m_subcommand_dict[std::string(name)] = cmd_obj;
80  } else
81  success = false;
82 
83  return success;
84 }
85 
86 bool CommandObjectMultiword::Execute(const char *args_string,
87  CommandReturnObject &result) {
88  Args args(args_string);
89  const size_t argc = args.GetArgumentCount();
90  if (argc == 0) {
91  this->CommandObject::GenerateHelpText(result);
92  return result.Succeeded();
93  }
94 
95  auto sub_command = args[0].ref();
96  if (sub_command.empty()) {
97  result.AppendError("Need to specify a non-empty subcommand.");
98  return result.Succeeded();
99  }
100 
101  if (sub_command.equals_lower("help")) {
102  this->CommandObject::GenerateHelpText(result);
103  return result.Succeeded();
104  }
105 
106  if (m_subcommand_dict.empty()) {
107  result.AppendErrorWithFormat("'%s' does not have any subcommands.\n",
108  GetCommandName().str().c_str());
110  return false;
111  }
112 
113  StringList matches;
114  CommandObject *sub_cmd_obj = GetSubcommandObject(sub_command, &matches);
115  if (sub_cmd_obj != nullptr) {
116  // Now call CommandObject::Execute to process options in `rest_of_line`.
117  // From there the command-specific version of Execute will be called, with
118  // the processed arguments.
119 
120  args.Shift();
121  sub_cmd_obj->Execute(args_string, result);
122  return result.Succeeded();
123  }
124 
125  std::string error_msg;
126  const size_t num_subcmd_matches = matches.GetSize();
127  if (num_subcmd_matches > 0)
128  error_msg.assign("ambiguous command ");
129  else
130  error_msg.assign("invalid command ");
131 
132  error_msg.append("'");
133  error_msg.append(std::string(GetCommandName()));
134  error_msg.append(" ");
135  error_msg.append(std::string(sub_command));
136  error_msg.append("'.");
137 
138  if (num_subcmd_matches > 0) {
139  error_msg.append(" Possible completions:");
140  for (const std::string &match : matches) {
141  error_msg.append("\n\t");
142  error_msg.append(match);
143  }
144  }
145  error_msg.append("\n");
146  result.AppendRawError(error_msg.c_str());
148  return false;
149 }
150 
152  // First time through here, generate the help text for the object and push it
153  // to the return result object as well
154 
155  CommandObject::GenerateHelpText(output_stream);
156  output_stream.PutCString("\nThe following subcommands are supported:\n\n");
157 
158  CommandMap::iterator pos;
160 
161  if (max_len)
162  max_len += 4; // Indent the output by 4 spaces.
163 
164  for (pos = m_subcommand_dict.begin(); pos != m_subcommand_dict.end(); ++pos) {
165  std::string indented_command(" ");
166  indented_command.append(pos->first);
167  if (pos->second->WantsRawCommandString()) {
168  std::string help_text(std::string(pos->second->GetHelp()));
169  help_text.append(" Expects 'raw' input (see 'help raw-input'.)");
170  m_interpreter.OutputFormattedHelpText(output_stream, indented_command,
171  "--", help_text, max_len);
172  } else
173  m_interpreter.OutputFormattedHelpText(output_stream, indented_command,
174  "--", pos->second->GetHelp(),
175  max_len);
176  }
177 
178  output_stream.PutCString("\nFor more help on any particular subcommand, type "
179  "'help <command> <subcommand>'.\n");
180 }
181 
183  auto arg0 = request.GetParsedLine()[0].ref();
184  if (request.GetCursorIndex() == 0) {
185  StringList new_matches, descriptions;
187  &descriptions);
188  request.AddCompletions(new_matches, descriptions);
189 
190  if (new_matches.GetSize() == 1 &&
191  new_matches.GetStringAtIndex(0) != nullptr &&
192  (arg0 == new_matches.GetStringAtIndex(0))) {
193  StringList temp_matches;
194  CommandObject *cmd_obj = GetSubcommandObject(arg0, &temp_matches);
195  if (cmd_obj != nullptr) {
196  if (request.GetParsedLine().GetArgumentCount() != 1) {
197  request.GetParsedLine().Shift();
198  request.AppendEmptyArgument();
199  cmd_obj->HandleCompletion(request);
200  }
201  }
202  }
203  return;
204  }
205 
206  StringList new_matches;
207  CommandObject *sub_command_object = GetSubcommandObject(arg0, &new_matches);
208  if (sub_command_object == nullptr) {
209  request.AddCompletions(new_matches);
210  return;
211  }
212 
213  // Remove the one match that we got from calling GetSubcommandObject.
214  new_matches.DeleteStringAtIndex(0);
215  request.AddCompletions(new_matches);
216  request.ShiftArguments();
217  sub_command_object->HandleCompletion(request);
218 }
219 
220 const char *CommandObjectMultiword::GetRepeatCommand(Args &current_command_args,
221  uint32_t index) {
222  index++;
223  if (current_command_args.GetArgumentCount() <= index)
224  return nullptr;
225  CommandObject *sub_command_object =
226  GetSubcommandObject(current_command_args[index].ref());
227  if (sub_command_object == nullptr)
228  return nullptr;
229  return sub_command_object->GetRepeatCommand(current_command_args, index);
230 }
231 
233  llvm::StringRef search_word,
234  StringList &commands_found,
235  StringList &commands_help) {
236  CommandObject::CommandMap::const_iterator pos;
237 
238  for (pos = m_subcommand_dict.begin(); pos != m_subcommand_dict.end(); ++pos) {
239  const char *command_name = pos->first.c_str();
240  CommandObject *sub_cmd_obj = pos->second.get();
241  StreamString complete_command_name;
242 
243  complete_command_name << prefix << " " << command_name;
244 
245  if (sub_cmd_obj->HelpTextContainsWord(search_word)) {
246  commands_found.AppendString(complete_command_name.GetString());
247  commands_help.AppendString(sub_cmd_obj->GetHelp());
248  }
249 
250  if (sub_cmd_obj->IsMultiwordObject())
251  sub_cmd_obj->AproposAllSubCommands(complete_command_name.GetString(),
252  search_word, commands_found,
253  commands_help);
254  }
255 }
256 
258  const char *name, const char *help,
259  const char *syntax, uint32_t flags)
260  : CommandObject(interpreter, name, help, syntax, flags) {}
261 
263 
265  CommandObject *proxy_command = GetProxyCommandObject();
266  if (proxy_command)
267  return proxy_command->GetOptions();
268  return CommandObject::GetOptions();
269 }
270 
271 llvm::StringRef CommandObjectProxy::GetHelp() {
272  CommandObject *proxy_command = GetProxyCommandObject();
273  if (proxy_command)
274  return proxy_command->GetHelp();
275  return CommandObject::GetHelp();
276 }
277 
278 llvm::StringRef CommandObjectProxy::GetSyntax() {
279  CommandObject *proxy_command = GetProxyCommandObject();
280  if (proxy_command)
281  return proxy_command->GetSyntax();
282  return CommandObject::GetSyntax();
283 }
284 
286  CommandObject *proxy_command = GetProxyCommandObject();
287  if (proxy_command)
288  return proxy_command->GetHelpLong();
290 }
291 
293  const CommandObject *proxy_command =
294  const_cast<CommandObjectProxy *>(this)->GetProxyCommandObject();
295  if (proxy_command)
296  return proxy_command->IsRemovable();
297  return false;
298 }
299 
301  CommandObject *proxy_command = GetProxyCommandObject();
302  if (proxy_command)
303  return proxy_command->IsMultiwordObject();
304  return false;
305 }
306 
308  CommandObject *proxy_command = GetProxyCommandObject();
309  if (proxy_command)
310  return proxy_command->GetAsMultiwordCommand();
311  return nullptr;
312 }
313 
315  CommandObject *proxy_command = GetProxyCommandObject();
316  if (proxy_command)
317  proxy_command->GenerateHelpText(result);
318  else
320 }
321 
322 lldb::CommandObjectSP
323 CommandObjectProxy::GetSubcommandSP(llvm::StringRef sub_cmd,
324  StringList *matches) {
325  CommandObject *proxy_command = GetProxyCommandObject();
326  if (proxy_command)
327  return proxy_command->GetSubcommandSP(sub_cmd, matches);
328  return lldb::CommandObjectSP();
329 }
330 
332  StringList *matches) {
333  CommandObject *proxy_command = GetProxyCommandObject();
334  if (proxy_command)
335  return proxy_command->GetSubcommandObject(sub_cmd, matches);
336  return nullptr;
337 }
338 
339 void CommandObjectProxy::AproposAllSubCommands(llvm::StringRef prefix,
340  llvm::StringRef search_word,
341  StringList &commands_found,
342  StringList &commands_help) {
343  CommandObject *proxy_command = GetProxyCommandObject();
344  if (proxy_command)
345  return proxy_command->AproposAllSubCommands(prefix, search_word,
346  commands_found, commands_help);
347 }
348 
350  llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_sp) {
351  CommandObject *proxy_command = GetProxyCommandObject();
352  if (proxy_command)
353  return proxy_command->LoadSubCommand(cmd_name, command_sp);
354  return false;
355 }
356 
358  CommandObject *proxy_command = GetProxyCommandObject();
359  if (proxy_command)
360  return proxy_command->WantsRawCommandString();
361  return false;
362 }
363 
365  CommandObject *proxy_command = GetProxyCommandObject();
366  if (proxy_command)
367  return proxy_command->WantsCompletion();
368  return false;
369 }
370 
372  CommandObject *proxy_command = GetProxyCommandObject();
373  if (proxy_command)
374  proxy_command->HandleCompletion(request);
375 }
376 
378  CompletionRequest &request, OptionElementVector &opt_element_vector) {
379  CommandObject *proxy_command = GetProxyCommandObject();
380  if (proxy_command)
381  proxy_command->HandleArgumentCompletion(request, opt_element_vector);
382 }
383 
384 const char *CommandObjectProxy::GetRepeatCommand(Args &current_command_args,
385  uint32_t index) {
386  CommandObject *proxy_command = GetProxyCommandObject();
387  if (proxy_command)
388  return proxy_command->GetRepeatCommand(current_command_args, index);
389  return nullptr;
390 }
391 
393  return "command is not implemented";
394 }
395 
396 bool CommandObjectProxy::Execute(const char *args_string,
397  CommandReturnObject &result) {
398  CommandObject *proxy_command = GetProxyCommandObject();
399  if (proxy_command)
400  return proxy_command->Execute(args_string, result);
401  result.SetError(GetUnsupportedError());
402  return false;
403 }
lldb_private::CommandObjectProxy::IsMultiwordObject
bool IsMultiwordObject() override
Definition: CommandObjectMultiword.cpp:300
lldb_private::CommandObjectMultiword::m_subcommand_dict
CommandObject::CommandMap m_subcommand_dict
Definition: CommandObjectMultiword.h:69
lldb_private::CommandObjectProxy::HandleArgumentCompletion
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The input array contains a parsed version of the line.
Definition: CommandObjectMultiword.cpp:377
lldb_private::CommandObjectProxy::GetOptions
Options * GetOptions() override
Definition: CommandObjectMultiword.cpp:264
lldb_private::CommandReturnObject::SetError
void SetError(const Status &error, const char *fallback_error_cstr=nullptr)
Definition: CommandReturnObject.cpp:106
lldb_private::CommandObject::Execute
virtual bool Execute(const char *args_string, CommandReturnObject &result)=0
lldb_private::CommandObjectProxy::WantsRawCommandString
bool WantsRawCommandString() override
Definition: CommandObjectMultiword.cpp:357
lldb_private::CommandObjectProxy::GetHelpLong
llvm::StringRef GetHelpLong() override
Definition: CommandObjectMultiword.cpp:285
lldb_private::CompletionRequest::GetParsedLine
const Args & GetParsedLine() const
Definition: CompletionRequest.h:134
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:309
lldb_private::CommandObject::GetHelpLong
virtual llvm::StringRef GetHelpLong()
Definition: CommandObject.cpp:55
lldb_private::Args::Shift
void Shift()
Shifts the first argument C string value of the array off the argument array.
Definition: Args.cpp:281
lldb_private::CommandObjectProxy::~CommandObjectProxy
~CommandObjectProxy() override
lldb_private::CommandObjectProxy::GetHelp
llvm::StringRef GetHelp() override
Definition: CommandObjectMultiword.cpp:271
lldb_private::StringList::AppendString
void AppendString(const std::string &s)
Definition: StringList.cpp:43
lldb_private::CommandReturnObject::AppendRawError
void AppendRawError(llvm::StringRef in_string)
Definition: CommandReturnObject.cpp:125
lldb_private::CommandObject::LoadSubCommand
virtual bool LoadSubCommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj)
Definition: CommandObject.h:181
lldb_private::CommandObject::GetSubcommandObject
virtual CommandObject * GetSubcommandObject(llvm::StringRef sub_cmd, StringList *matches=nullptr)
Definition: CommandObject.h:162
lldb_private::Stream
Definition: Stream.h:28
lldb_private::CompletionRequest::AppendEmptyArgument
void AppendEmptyArgument()
Adds an empty argument at the end of the argument list and moves the cursor to this new argument.
Definition: CompletionRequest.h:150
lldb_private::Args
Definition: Args.h:33
lldb_private::CommandObjectMultiword::GetSubcommandSP
lldb::CommandObjectSP GetSubcommandSP(llvm::StringRef sub_cmd, StringList *matches=nullptr) override
Definition: CommandObjectMultiword.cpp:29
lldb_private::CommandObjectProxy::CommandObjectProxy
CommandObjectProxy(CommandInterpreter &interpreter, const char *name, const char *help=nullptr, const char *syntax=nullptr, uint32_t flags=0)
Definition: CommandObjectMultiword.cpp:257
CommandReturnObject.h
lldb_private::StreamString::GetString
llvm::StringRef GetString() const
Definition: StreamString.cpp:51
lldb_private::StringList::GetSize
size_t GetSize() const
Definition: StringList.cpp:68
lldb_private::CommandObjectMultiword
Definition: CommandObjectMultiword.h:19
Options.h
lldb_private::CommandObject::GetAsMultiwordCommand
virtual CommandObjectMultiword * GetAsMultiwordCommand()
Definition: CommandObject.h:148
lldb_private::Options
Definition: Options.h:57
lldb_private::StringList::GetStringAtIndex
const char * GetStringAtIndex(size_t idx) const
Definition: StringList.cpp:80
lldb_private::CommandObjectProxy::GetSyntax
llvm::StringRef GetSyntax() override
Definition: CommandObjectMultiword.cpp:278
lldb_private::CommandObject::GetSyntax
virtual llvm::StringRef GetSyntax()
Definition: CommandObject.cpp:57
lldb_private::CommandObject::GetRepeatCommand
virtual const char * GetRepeatCommand(Args &current_command_args, uint32_t index)
Get the command that appropriate for a "repeat" of the current command.
Definition: CommandObject.h:274
lldb_private::CommandObjectMultiword::LoadSubCommand
bool LoadSubCommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj) override
Definition: CommandObjectMultiword.cpp:68
lldb_private::CommandReturnObject::SetStatus
void SetStatus(lldb::ReturnStatus status)
Definition: CommandReturnObject.cpp:131
lldb_private::CommandObject::IsRemovable
virtual bool IsRemovable() const
Definition: CommandObject.h:144
lldb_private::CommandObjectProxy::AproposAllSubCommands
void AproposAllSubCommands(llvm::StringRef prefix, llvm::StringRef search_word, StringList &commands_found, StringList &commands_help) override
Definition: CommandObjectMultiword.cpp:339
lldb_private::CommandObjectProxy::GetUnsupportedError
virtual llvm::StringRef GetUnsupportedError()
Definition: CommandObjectMultiword.cpp:392
lldb_private::CommandObjectProxy::Execute
bool Execute(const char *args_string, CommandReturnObject &result) override
Definition: CommandObjectMultiword.cpp:396
lldb_private::CommandObjectProxy::LoadSubCommand
bool LoadSubCommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj) override
Definition: CommandObjectMultiword.cpp:349
lldb_private::CommandObjectProxy::GetSubcommandSP
lldb::CommandObjectSP GetSubcommandSP(llvm::StringRef sub_cmd, StringList *matches=nullptr) override
Definition: CommandObjectMultiword.cpp:323
lldb_private::StringList
Definition: StringList.h:25
lldb_private::CommandObjectMultiword::HandleCompletion
void HandleCompletion(CompletionRequest &request) override
This default version handles calling option argument completions and then calls HandleArgumentComplet...
Definition: CommandObjectMultiword.cpp:182
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:242
lldb_private::CommandObject::GetCommandName
llvm::StringRef GetCommandName() const
Definition: CommandObject.cpp:80
lldb_private::CommandObject::GetOptions
virtual Options * GetOptions()
Definition: CommandObject.cpp:98
lldb_private::CommandInterpreter
Definition: CommandInterpreter.h:221
CommandObjectMultiword.h
lldb::eReturnStatusFailed
@ eReturnStatusFailed
Definition: lldb-enumerations.h:265
lldb_private::CommandObject::m_interpreter
CommandInterpreter & m_interpreter
Definition: CommandObject.h:358
lldb_private::OptionElementVector
std::vector< OptionArgElement > OptionElementVector
Definition: Options.h:42
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:38
lldb_private::CompletionRequest::AddCompletions
void AddCompletions(const StringList &completions)
Adds multiple possible completion strings.
Definition: CompletionRequest.h:196
lldb_private::CommandObjectProxy::GetRepeatCommand
const char * GetRepeatCommand(Args &current_command_args, uint32_t index) override
Get the command that appropriate for a "repeat" of the current command.
Definition: CommandObjectMultiword.cpp:384
lldb_private::CommandObjectProxy::GetProxyCommandObject
virtual CommandObject * GetProxyCommandObject()=0
lldb_private::CommandObjectMultiword::GenerateHelpText
void GenerateHelpText(Stream &output_stream) override
Definition: CommandObjectMultiword.cpp:151
lldb_private::CommandObjectProxy::WantsCompletion
bool WantsCompletion() override
Definition: CommandObjectMultiword.cpp:364
lldb_private::CommandObject
Definition: CommandObject.h:67
lldb_private::CommandObjectProxy
Definition: CommandObjectMultiword.h:73
lldb_private::AddNamesMatchingPartialString
int AddNamesMatchingPartialString(const std::map< std::string, ValueType > &in_map, llvm::StringRef cmd_str, StringList &matches, StringList *descriptions=nullptr)
Definition: CommandObject.h:35
lldb_private::CommandReturnObject
Definition: CommandReturnObject.h:25
uint32_t
lldb_private::CommandObject::IsMultiwordObject
virtual bool IsMultiwordObject()
Definition: CommandObject.h:146
lldb_private::FindLongestCommandWord
size_t FindLongestCommandWord(std::map< std::string, ValueType > &dict)
Definition: CommandObject.h:55
lldb_private::CommandObject::HandleCompletion
virtual void HandleCompletion(CompletionRequest &request)
This default version handles calling option argument completions and then calls HandleArgumentComplet...
Definition: CommandObject.cpp:276
lldb_private::CommandObjectMultiword::GetRepeatCommand
const char * GetRepeatCommand(Args &current_command_args, uint32_t index) override
Get the command that appropriate for a "repeat" of the current command.
Definition: CommandObjectMultiword.cpp:220
lldb_private::CommandObjectMultiword::GetSubcommandObject
CommandObject * GetSubcommandObject(llvm::StringRef sub_cmd, StringList *matches=nullptr) override
Definition: CommandObjectMultiword.cpp:63
lldb_private::CommandObjectProxy::IsRemovable
bool IsRemovable() const override
Definition: CommandObjectMultiword.cpp:292
lldb_private::CommandObjectMultiword::~CommandObjectMultiword
~CommandObjectMultiword() override
lldb_private::CommandObject::GetSubcommandSP
virtual lldb::CommandObjectSP GetSubcommandSP(llvm::StringRef sub_cmd, StringList *matches=nullptr)
Definition: CommandObject.h:157
lldb_private::CompletionRequest::ShiftArguments
void ShiftArguments()
Drops the first argument from the argument list.
Definition: CompletionRequest.h:143
lldb_private::StringList::DeleteStringAtIndex
void DeleteStringAtIndex(size_t id)
Definition: StringList.cpp:141
lldb_private::CommandReturnObject::Succeeded
bool Succeeded()
Definition: CommandReturnObject.cpp:135
lldb_private::CommandObject::AproposAllSubCommands
virtual void AproposAllSubCommands(llvm::StringRef prefix, llvm::StringRef search_word, StringList &commands_found, StringList &commands_help)
Definition: CommandObject.h:167
lldb_private::CommandObject::GetCommandInterpreter
CommandInterpreter & GetCommandInterpreter()
Definition: CommandObject.h:124
lldb_private::CommandObjectMultiword::AproposAllSubCommands
void AproposAllSubCommands(llvm::StringRef prefix, llvm::StringRef search_word, StringList &commands_found, StringList &commands_help) override
Definition: CommandObjectMultiword.cpp:232
lldb_private::CommandReturnObject::AppendErrorWithFormat
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
Definition: CommandReturnObject.cpp:48
lldb_private::CompletionRequest::GetCursorIndex
size_t GetCursorIndex() const
Definition: CompletionRequest.h:156
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::CommandObjectProxy::GetSubcommandObject
CommandObject * GetSubcommandObject(llvm::StringRef sub_cmd, StringList *matches=nullptr) override
Definition: CommandObjectMultiword.cpp:331
lldb_private::CommandObject::WantsCompletion
virtual bool WantsCompletion()
Definition: CommandObject.h:191
CommandInterpreter.h
lldb_private::Stream::PutCString
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:63
lldb_private::CommandInterpreter::OutputFormattedHelpText
void OutputFormattedHelpText(Stream &strm, llvm::StringRef prefix, llvm::StringRef help_text)
lldb_private::CommandObjectProxy::GetAsMultiwordCommand
CommandObjectMultiword * GetAsMultiwordCommand() override
Definition: CommandObjectMultiword.cpp:307
lldb_private::CommandReturnObject::AppendError
void void AppendError(llvm::StringRef in_string)
Definition: CommandReturnObject.cpp:100
lldb_private::Args::GetArgumentCount
size_t GetArgumentCount() const
Gets the number of arguments left in this command object.
Definition: Args.h:118
lldb
Definition: SBAddress.h:15
lldb_private::CommandObjectProxy::HandleCompletion
void HandleCompletion(CompletionRequest &request) override
This default version handles calling option argument completions and then calls HandleArgumentComplet...
Definition: CommandObjectMultiword.cpp:371
lldb_private::CommandObjectProxy::GenerateHelpText
void GenerateHelpText(Stream &result) override
Definition: CommandObjectMultiword.cpp:314
lldb_private::CommandObject::WantsRawCommandString
virtual bool WantsRawCommandString()=0
lldb_private::CommandObject::GetHelp
virtual llvm::StringRef GetHelp()
Definition: CommandObject.cpp:53
lldb_private::CompletionRequest
Definition: CompletionRequest.h:100
lldb_private::CommandObjectMultiword::Execute
bool Execute(const char *args_string, CommandReturnObject &result) override
Definition: CommandObjectMultiword.cpp:86
lldb_private::CommandObject::GenerateHelpText
void GenerateHelpText(CommandReturnObject &result)
Definition: CommandObject.cpp:850