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
31  if (m_subcommand_dict.empty())
32  return {};
33 
34  auto pos = m_subcommand_dict.find(std::string(sub_cmd));
35  if (pos == m_subcommand_dict.end())
36  return {};
37 
38  return pos->second;
39 }
40 
41 CommandObjectSP CommandObjectMultiword::GetSubcommandSP(llvm::StringRef sub_cmd,
42  StringList *matches) {
43  if (m_subcommand_dict.empty())
44  return {};
45 
46  CommandObjectSP return_cmd_sp = GetSubcommandSPExact(sub_cmd);
47  if (return_cmd_sp) {
48  if (matches)
49  matches->AppendString(sub_cmd);
50  return return_cmd_sp;
51  }
52 
53  CommandObject::CommandMap::iterator pos;
54 
55  StringList local_matches;
56  if (matches == nullptr)
57  matches = &local_matches;
58  int num_matches =
60 
61  if (num_matches == 1) {
62  // Cleaner, but slightly less efficient would be to call back into this
63  // function, since I now know I have an exact match...
64 
65  sub_cmd = matches->GetStringAtIndex(0);
66  pos = m_subcommand_dict.find(std::string(sub_cmd));
67  if (pos != m_subcommand_dict.end())
68  return_cmd_sp = pos->second;
69  }
70 
71  return return_cmd_sp;
72 }
73 
76  StringList *matches) {
77  return GetSubcommandSP(sub_cmd, matches).get();
78 }
79 
80 bool CommandObjectMultiword::LoadSubCommand(llvm::StringRef name,
81  const CommandObjectSP &cmd_obj_sp) {
82  if (cmd_obj_sp)
83  lldbassert((&GetCommandInterpreter() == &cmd_obj_sp->GetCommandInterpreter()) &&
84  "tried to add a CommandObject from a different interpreter");
85 
86  CommandMap::iterator pos;
87  bool success = true;
88 
89  pos = m_subcommand_dict.find(std::string(name));
90  if (pos == m_subcommand_dict.end()) {
91  m_subcommand_dict[std::string(name)] = cmd_obj_sp;
92  } else
93  success = false;
94 
95  return success;
96 }
97 
99  llvm::StringRef name, const CommandObjectSP &cmd_obj_sp, bool can_replace) {
100  Status result;
101  if (cmd_obj_sp)
102  lldbassert((&GetCommandInterpreter() == &cmd_obj_sp->GetCommandInterpreter()) &&
103  "tried to add a CommandObject from a different interpreter");
104  if (!IsUserCommand()) {
105  return llvm::createStringError(llvm::inconvertibleErrorCode(),
106  "can't add a user subcommand to a builtin container command.");
107  }
108  // Make sure this a user command if it isn't already:
109  cmd_obj_sp->SetIsUserCommand(true);
110 
111  std::string str_name(name);
112 
113  auto pos = m_subcommand_dict.find(str_name);
114  if (pos == m_subcommand_dict.end()) {
115  m_subcommand_dict[str_name] = cmd_obj_sp;
116  return llvm::Error::success();
117  }
118 
119  const char *error_str = nullptr;
120  if (!can_replace)
121  error_str = "sub-command already exists";
122  if (!(*pos).second->IsUserCommand())
123  error_str = "can't replace a builtin subcommand";
124 
125  if (error_str) {
126  return llvm::createStringError(llvm::inconvertibleErrorCode(), error_str);
127  }
128  m_subcommand_dict[str_name] = cmd_obj_sp;
129  return llvm::Error::success();
130 }
131 
133  bool must_be_multiword) {
134  CommandMap::iterator pos;
135  std::string str_name(cmd_name);
136 
137  pos = m_subcommand_dict.find(str_name);
138  if (pos == m_subcommand_dict.end()) {
139  return llvm::createStringError(llvm::inconvertibleErrorCode(),"subcommand '%s' not found.",
140  str_name.c_str());
141  }
142  if (!(*pos).second->IsUserCommand()) {
143  return llvm::createStringError(llvm::inconvertibleErrorCode(),"subcommand '%s' not a user command.",
144  str_name.c_str());
145  }
146 
147  if (must_be_multiword && !(*pos).second->IsMultiwordObject()) {
148  return llvm::createStringError(llvm::inconvertibleErrorCode(),"subcommand '%s' is not a container command",
149  str_name.c_str());
150  }
151  if (!must_be_multiword && (*pos).second->IsMultiwordObject()) {
152  return llvm::createStringError(llvm::inconvertibleErrorCode(),"subcommand '%s' is not a user command",
153  str_name.c_str());
154  }
155 
156  m_subcommand_dict.erase(pos);
157 
158  return llvm::Error::success();
159 }
160 
161 bool CommandObjectMultiword::Execute(const char *args_string,
162  CommandReturnObject &result) {
163  Args args(args_string);
164  const size_t argc = args.GetArgumentCount();
165  if (argc == 0) {
166  this->CommandObject::GenerateHelpText(result);
167  return result.Succeeded();
168  }
169 
170  auto sub_command = args[0].ref();
171  if (sub_command.empty()) {
172  result.AppendError("Need to specify a non-empty subcommand.");
173  return result.Succeeded();
174  }
175 
176  if (sub_command.equals_insensitive("help")) {
177  this->CommandObject::GenerateHelpText(result);
178  return result.Succeeded();
179  }
180 
181  if (m_subcommand_dict.empty()) {
182  result.AppendErrorWithFormat("'%s' does not have any subcommands.\n",
183  GetCommandName().str().c_str());
184  return false;
185  }
186 
187  StringList matches;
188  CommandObject *sub_cmd_obj = GetSubcommandObject(sub_command, &matches);
189  if (sub_cmd_obj != nullptr) {
190  // Now call CommandObject::Execute to process options in `rest_of_line`.
191  // From there the command-specific version of Execute will be called, with
192  // the processed arguments.
193 
194  args.Shift();
195  sub_cmd_obj->Execute(args_string, result);
196  return result.Succeeded();
197  }
198 
199  std::string error_msg;
200  const size_t num_subcmd_matches = matches.GetSize();
201  if (num_subcmd_matches > 0)
202  error_msg.assign("ambiguous command ");
203  else
204  error_msg.assign("invalid command ");
205 
206  error_msg.append("'");
207  error_msg.append(std::string(GetCommandName()));
208  error_msg.append(" ");
209  error_msg.append(std::string(sub_command));
210  error_msg.append("'.");
211 
212  if (num_subcmd_matches > 0) {
213  error_msg.append(" Possible completions:");
214  for (const std::string &match : matches) {
215  error_msg.append("\n\t");
216  error_msg.append(match);
217  }
218  }
219  error_msg.append("\n");
220  result.AppendRawError(error_msg.c_str());
221  return false;
222 }
223 
225  // First time through here, generate the help text for the object and push it
226  // to the return result object as well
227 
228  CommandObject::GenerateHelpText(output_stream);
229  output_stream.PutCString("\nThe following subcommands are supported:\n\n");
230 
231  CommandMap::iterator pos;
233 
234  if (max_len)
235  max_len += 4; // Indent the output by 4 spaces.
236 
237  for (pos = m_subcommand_dict.begin(); pos != m_subcommand_dict.end(); ++pos) {
238  std::string indented_command(" ");
239  indented_command.append(pos->first);
240  if (pos->second->WantsRawCommandString()) {
241  std::string help_text(std::string(pos->second->GetHelp()));
242  help_text.append(" Expects 'raw' input (see 'help raw-input'.)");
243  m_interpreter.OutputFormattedHelpText(output_stream, indented_command,
244  "--", help_text, max_len);
245  } else
246  m_interpreter.OutputFormattedHelpText(output_stream, indented_command,
247  "--", pos->second->GetHelp(),
248  max_len);
249  }
250 
251  output_stream.PutCString("\nFor more help on any particular subcommand, type "
252  "'help <command> <subcommand>'.\n");
253 }
254 
256  auto arg0 = request.GetParsedLine()[0].ref();
257  if (request.GetCursorIndex() == 0) {
258  StringList new_matches, descriptions;
260  &descriptions);
261  request.AddCompletions(new_matches, descriptions);
262 
263  if (new_matches.GetSize() == 1 &&
264  new_matches.GetStringAtIndex(0) != nullptr &&
265  (arg0 == new_matches.GetStringAtIndex(0))) {
266  StringList temp_matches;
267  CommandObject *cmd_obj = GetSubcommandObject(arg0, &temp_matches);
268  if (cmd_obj != nullptr) {
269  if (request.GetParsedLine().GetArgumentCount() != 1) {
270  request.GetParsedLine().Shift();
271  request.AppendEmptyArgument();
272  cmd_obj->HandleCompletion(request);
273  }
274  }
275  }
276  return;
277  }
278 
279  StringList new_matches;
280  CommandObject *sub_command_object = GetSubcommandObject(arg0, &new_matches);
281  if (sub_command_object == nullptr) {
282  request.AddCompletions(new_matches);
283  return;
284  }
285 
286  // Remove the one match that we got from calling GetSubcommandObject.
287  new_matches.DeleteStringAtIndex(0);
288  request.AddCompletions(new_matches);
289  request.ShiftArguments();
290  sub_command_object->HandleCompletion(request);
291 }
292 
293 llvm::Optional<std::string>
295  uint32_t index) {
296  index++;
297  if (current_command_args.GetArgumentCount() <= index)
298  return llvm::None;
299  CommandObject *sub_command_object =
300  GetSubcommandObject(current_command_args[index].ref());
301  if (sub_command_object == nullptr)
302  return llvm::None;
303  return sub_command_object->GetRepeatCommand(current_command_args, index);
304 }
305 
307  const char *name, const char *help,
308  const char *syntax, uint32_t flags)
309  : CommandObject(interpreter, name, help, syntax, flags) {}
310 
312 
314  CommandObject *proxy_command = GetProxyCommandObject();
315  if (proxy_command)
316  return proxy_command->GetOptions();
317  return CommandObject::GetOptions();
318 }
319 
320 llvm::StringRef CommandObjectProxy::GetHelp() {
321  CommandObject *proxy_command = GetProxyCommandObject();
322  if (proxy_command)
323  return proxy_command->GetHelp();
324  return CommandObject::GetHelp();
325 }
326 
327 llvm::StringRef CommandObjectProxy::GetSyntax() {
328  CommandObject *proxy_command = GetProxyCommandObject();
329  if (proxy_command)
330  return proxy_command->GetSyntax();
331  return CommandObject::GetSyntax();
332 }
333 
335  CommandObject *proxy_command = GetProxyCommandObject();
336  if (proxy_command)
337  return proxy_command->GetHelpLong();
339 }
340 
342  const CommandObject *proxy_command =
343  const_cast<CommandObjectProxy *>(this)->GetProxyCommandObject();
344  if (proxy_command)
345  return proxy_command->IsRemovable();
346  return false;
347 }
348 
350  CommandObject *proxy_command = GetProxyCommandObject();
351  if (proxy_command)
352  return proxy_command->IsMultiwordObject();
353  return false;
354 }
355 
357  CommandObject *proxy_command = GetProxyCommandObject();
358  if (proxy_command)
359  return proxy_command->GetAsMultiwordCommand();
360  return nullptr;
361 }
362 
364  CommandObject *proxy_command = GetProxyCommandObject();
365  if (proxy_command)
366  proxy_command->GenerateHelpText(result);
367  else
369 }
370 
371 lldb::CommandObjectSP
372 CommandObjectProxy::GetSubcommandSP(llvm::StringRef sub_cmd,
373  StringList *matches) {
374  CommandObject *proxy_command = GetProxyCommandObject();
375  if (proxy_command)
376  return proxy_command->GetSubcommandSP(sub_cmd, matches);
377  return lldb::CommandObjectSP();
378 }
379 
381  StringList *matches) {
382  CommandObject *proxy_command = GetProxyCommandObject();
383  if (proxy_command)
384  return proxy_command->GetSubcommandObject(sub_cmd, matches);
385  return nullptr;
386 }
387 
389  llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_sp) {
390  CommandObject *proxy_command = GetProxyCommandObject();
391  if (proxy_command)
392  return proxy_command->LoadSubCommand(cmd_name, command_sp);
393  return false;
394 }
395 
397  CommandObject *proxy_command = GetProxyCommandObject();
398  if (proxy_command)
399  return proxy_command->WantsRawCommandString();
400  return false;
401 }
402 
404  CommandObject *proxy_command = GetProxyCommandObject();
405  if (proxy_command)
406  return proxy_command->WantsCompletion();
407  return false;
408 }
409 
411  CommandObject *proxy_command = GetProxyCommandObject();
412  if (proxy_command)
413  proxy_command->HandleCompletion(request);
414 }
415 
417  CompletionRequest &request, OptionElementVector &opt_element_vector) {
418  CommandObject *proxy_command = GetProxyCommandObject();
419  if (proxy_command)
420  proxy_command->HandleArgumentCompletion(request, opt_element_vector);
421 }
422 
423 llvm::Optional<std::string>
425  uint32_t index) {
426  CommandObject *proxy_command = GetProxyCommandObject();
427  if (proxy_command)
428  return proxy_command->GetRepeatCommand(current_command_args, index);
429  return llvm::None;
430 }
431 
433  return "command is not implemented";
434 }
435 
436 bool CommandObjectProxy::Execute(const char *args_string,
437  CommandReturnObject &result) {
438  CommandObject *proxy_command = GetProxyCommandObject();
439  if (proxy_command)
440  return proxy_command->Execute(args_string, result);
442  return false;
443 }
lldb_private::CommandObjectProxy::IsMultiwordObject
bool IsMultiwordObject() override
Definition: CommandObjectMultiword.cpp:349
lldb_private::CommandObjectMultiword::m_subcommand_dict
CommandObject::CommandMap m_subcommand_dict
Definition: CommandObjectMultiword.h:72
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:416
lldb_private::CommandObjectProxy::GetOptions
Options * GetOptions() override
Definition: CommandObjectMultiword.cpp:313
lldb_private::CommandObject::Execute
virtual bool Execute(const char *args_string, CommandReturnObject &result)=0
lldb_private::CommandObjectProxy::WantsRawCommandString
bool WantsRawCommandString() override
Definition: CommandObjectMultiword.cpp:396
lldb_private::CommandObjectProxy::GetHelpLong
llvm::StringRef GetHelpLong() override
Definition: CommandObjectMultiword.cpp:334
lldb_private::CompletionRequest::GetParsedLine
const Args & GetParsedLine() const
Definition: CompletionRequest.h:134
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:320
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:121
lldb_private::CommandObject::LoadSubCommand
virtual bool LoadSubCommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj)
Definition: CommandObject.h:184
lldb_private::CommandObject::GetSubcommandObject
virtual CommandObject * GetSubcommandObject(llvm::StringRef sub_cmd, StringList *matches=nullptr)
Definition: CommandObject.h:170
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::CommandReturnObject::Succeeded
bool Succeeded() const
Definition: CommandReturnObject.cpp:131
lldb_private::CommandObjectMultiword::GetSubcommandSP
lldb::CommandObjectSP GetSubcommandSP(llvm::StringRef sub_cmd, StringList *matches=nullptr) override
Definition: CommandObjectMultiword.cpp:41
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:306
CommandReturnObject.h
lldb_private::CommandObjectMultiword::GetRepeatCommand
llvm::Optional< std::string > GetRepeatCommand(Args &current_command_args, uint32_t index) override
Get the command that appropriate for a "repeat" of the current command.
Definition: CommandObjectMultiword.cpp:294
lldb_private::StringList::GetSize
size_t GetSize() const
Definition: StringList.cpp:74
lldb_private::CommandObject::IsUserCommand
bool IsUserCommand()
Definition: CommandObject.h:148
lldb_private::CommandObjectMultiword
Definition: CommandObjectMultiword.h:19
Options.h
lldb_private::CommandObject::GetAsMultiwordCommand
virtual CommandObjectMultiword * GetAsMultiwordCommand()
Definition: CommandObject.h:152
lldb_private::Options
Definition: Options.h:57
lldb_private::StringList::GetStringAtIndex
const char * GetStringAtIndex(size_t idx) const
Definition: StringList.cpp:86
lldb_private::CommandObjectProxy::GetSyntax
llvm::StringRef GetSyntax() override
Definition: CommandObjectMultiword.cpp:327
lldb_private::CommandObjectMultiword::LoadUserSubcommand
llvm::Error LoadUserSubcommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj, bool can_replace) override
Definition: CommandObjectMultiword.cpp:98
lldb_private::CommandObject::GetSyntax
virtual llvm::StringRef GetSyntax()
Definition: CommandObject.cpp:57
lldb_private::CommandObjectMultiword::LoadSubCommand
bool LoadSubCommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj) override
Definition: CommandObjectMultiword.cpp:80
lldb_private::CommandObject::IsRemovable
virtual bool IsRemovable() const
Definition: CommandObject.h:144
lldb_private::CommandObjectProxy::GetUnsupportedError
virtual llvm::StringRef GetUnsupportedError()
Definition: CommandObjectMultiword.cpp:432
lldb_private::CommandObjectProxy::Execute
bool Execute(const char *args_string, CommandReturnObject &result) override
Definition: CommandObjectMultiword.cpp:436
lldb_private::CommandObjectProxy::GetRepeatCommand
llvm::Optional< std::string > GetRepeatCommand(Args &current_command_args, uint32_t index) override
Get the command that appropriate for a "repeat" of the current command.
Definition: CommandObjectMultiword.cpp:424
lldb_private::CommandObjectProxy::LoadSubCommand
bool LoadSubCommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj) override
Definition: CommandObjectMultiword.cpp:388
lldb_private::CommandObjectProxy::GetSubcommandSP
lldb::CommandObjectSP GetSubcommandSP(llvm::StringRef sub_cmd, StringList *matches=nullptr) override
Definition: CommandObjectMultiword.cpp:372
lldb_private::StringList
Definition: StringList.h:26
lldb_private::CommandObjectMultiword::HandleCompletion
void HandleCompletion(CompletionRequest &request) override
This default version handles calling option argument completions and then calls HandleArgumentComplet...
Definition: CommandObjectMultiword.cpp:255
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:252
lldb_private::CommandObject::GetRepeatCommand
virtual llvm::Optional< std::string > GetRepeatCommand(Args &current_command_args, uint32_t index)
Get the command that appropriate for a "repeat" of the current command.
Definition: CommandObject.h:284
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:214
CommandObjectMultiword.h
lldb_private::CommandObject::m_interpreter
CommandInterpreter & m_interpreter
Definition: CommandObject.h:372
lldb_private::OptionElementVector
std::vector< OptionArgElement > OptionElementVector
Definition: Options.h:42
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::CompletionRequest::AddCompletions
void AddCompletions(const StringList &completions)
Adds multiple possible completion strings.
Definition: CompletionRequest.h:196
lldb_private::CommandObjectProxy::GetProxyCommandObject
virtual CommandObject * GetProxyCommandObject()=0
lldb_private::CommandObjectMultiword::GenerateHelpText
void GenerateHelpText(Stream &output_stream) override
Definition: CommandObjectMultiword.cpp:224
lldb_private::CommandObjectProxy::WantsCompletion
bool WantsCompletion() override
Definition: CommandObjectMultiword.cpp:403
lldb_private::CommandObject
Definition: CommandObject.h:67
lldbassert
#define lldbassert(x)
Definition: LLDBAssert.h:15
lldb_private::CommandObjectProxy
Definition: CommandObjectMultiword.h:76
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::Status
Definition: Status.h:44
lldb_private::CommandObjectMultiword::GetSubcommandSPExact
lldb::CommandObjectSP GetSubcommandSPExact(llvm::StringRef sub_cmd) override
Definition: CommandObjectMultiword.cpp:30
lldb_private::CommandReturnObject
Definition: CommandReturnObject.h:26
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:273
lldb_private::CommandObjectMultiword::GetSubcommandObject
CommandObject * GetSubcommandObject(llvm::StringRef sub_cmd, StringList *matches=nullptr) override
Definition: CommandObjectMultiword.cpp:75
lldb_private::CommandObjectProxy::IsRemovable
bool IsRemovable() const override
Definition: CommandObjectMultiword.cpp:341
lldb_private::CommandObjectMultiword::~CommandObjectMultiword
~CommandObjectMultiword() override
lldb_private::CommandObject::GetSubcommandSP
virtual lldb::CommandObjectSP GetSubcommandSP(llvm::StringRef sub_cmd, StringList *matches=nullptr)
Definition: CommandObject.h:161
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:147
lldb_private::CommandObject::GetCommandInterpreter
CommandInterpreter & GetCommandInterpreter()
Definition: CommandObject.h:124
lldb_private::CommandReturnObject::AppendErrorWithFormat
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
Definition: CommandReturnObject.cpp:46
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:380
lldb_private::CommandObjectMultiword::RemoveUserSubcommand
llvm::Error RemoveUserSubcommand(llvm::StringRef cmd_name, bool multiword_okay)
Definition: CommandObjectMultiword.cpp:132
Error
llvm::Error Error
Definition: UdtRecordCompleter.cpp:30
lldb_private::CommandObject::WantsCompletion
virtual bool WantsCompletion()
Definition: CommandObject.h:201
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:356
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:410
lldb_private::CommandObjectProxy::GenerateHelpText
void GenerateHelpText(Stream &result) override
Definition: CommandObjectMultiword.cpp:363
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:161
lldb_private::CommandObject::GenerateHelpText
void GenerateHelpText(CommandReturnObject &result)
Definition: CommandObject.cpp:849