LLDB mainline
|
#include <CommandAlias.h>
Public Types | |
typedef std::unique_ptr< CommandAlias > | UniquePointer |
Public Types inherited from lldb_private::CommandObject | |
enum | IDType { eBreakpointArgs = 0 , eWatchpointArgs = 1 } |
typedef llvm::StringRef | ArgumentHelpCallbackFunction() |
typedef std::vector< CommandArgumentData > | CommandArgumentEntry |
typedef std::map< std::string, lldb::CommandObjectSP, std::less<> > | CommandMap |
Public Member Functions | |
CommandAlias (CommandInterpreter &interpreter, lldb::CommandObjectSP cmd_sp, llvm::StringRef options_args, llvm::StringRef name, llvm::StringRef help=llvm::StringRef(), llvm::StringRef syntax=llvm::StringRef(), uint32_t flags=0) | |
void | GetAliasExpansion (StreamString &help_string) const |
bool | IsValid () const |
operator bool () const | |
bool | WantsRawCommandString () override |
bool | WantsCompletion () override |
void | HandleCompletion (CompletionRequest &request) override |
This default version handles calling option argument completions and then calls HandleArgumentCompletion if the cursor is on an argument, not an option. | |
void | HandleArgumentCompletion (CompletionRequest &request, OptionElementVector &opt_element_vector) override |
The default version handles argument definitions that have only one argument type, and use one of the argument types that have an entry in the CommonCompletions. | |
Options * | GetOptions () override |
bool | IsAlias () override |
bool | IsDashDashCommand () override |
llvm::StringRef | GetHelp () override |
llvm::StringRef | GetHelpLong () override |
void | SetHelp (llvm::StringRef str) override |
void | SetHelpLong (llvm::StringRef str) override |
void | Execute (const char *args_string, CommandReturnObject &result) override |
lldb::CommandObjectSP | GetUnderlyingCommand () |
OptionArgVectorSP | GetOptionArguments () const |
const char * | GetOptionString () |
std::pair< lldb::CommandObjectSP, OptionArgVectorSP > | Desugar () |
Public Member Functions inherited from lldb_private::CommandObject | |
CommandObject (CommandInterpreter &interpreter, llvm::StringRef name, llvm::StringRef help="", llvm::StringRef syntax="", uint32_t flags=0) | |
virtual | ~CommandObject ()=default |
CommandInterpreter & | GetCommandInterpreter () |
Debugger & | GetDebugger () |
virtual llvm::StringRef | GetSyntax () |
llvm::StringRef | GetCommandName () const |
void | SetSyntax (llvm::StringRef str) |
virtual bool | IsRemovable () const |
virtual bool | IsMultiwordObject () |
bool | IsUserCommand () |
void | SetIsUserCommand (bool is_user) |
virtual CommandObjectMultiword * | GetAsMultiwordCommand () |
virtual lldb::CommandObjectSP | GetSubcommandSP (llvm::StringRef sub_cmd, StringList *matches=nullptr) |
virtual lldb::CommandObjectSP | GetSubcommandSPExact (llvm::StringRef sub_cmd) |
virtual CommandObject * | GetSubcommandObject (llvm::StringRef sub_cmd, StringList *matches=nullptr) |
void | FormatLongHelpText (Stream &output_strm, llvm::StringRef long_help) |
void | GenerateHelpText (CommandReturnObject &result) |
virtual void | GenerateHelpText (Stream &result) |
virtual bool | LoadSubCommand (llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj) |
virtual llvm::Error | LoadUserSubcommand (llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj, bool can_replace) |
void | AddSimpleArgumentList (lldb::CommandArgumentType arg_type, ArgumentRepetitionType repetition_type=eArgRepeatPlain) |
void | AddIDsArgumentData (IDType type) |
int | GetNumArgumentEntries () |
CommandArgumentEntry * | GetArgumentEntryAtIndex (int idx) |
void | GetFormattedCommandArguments (Stream &str, uint32_t opt_set_mask=LLDB_OPT_SET_ALL) |
bool | ParseOptions (Args &args, CommandReturnObject &result) |
void | SetCommandName (llvm::StringRef name) |
bool | HelpTextContainsWord (llvm::StringRef search_word, bool search_short_help=true, bool search_long_help=true, bool search_syntax=true, bool search_options=true) |
Flags & | GetFlags () |
The flags accessor. | |
const Flags & | GetFlags () const |
The flags const accessor. | |
virtual std::optional< std::string > | GetRepeatCommand (Args ¤t_command_args, uint32_t index) |
Get the command that appropriate for a "repeat" of the current command. | |
bool | HasOverrideCallback () const |
void | SetOverrideCallback (lldb::CommandOverrideCallback callback, void *baton) |
void | SetOverrideCallback (lldb_private::CommandOverrideCallbackWithResult callback, void *baton) |
bool | InvokeOverrideCallback (const char **argv, CommandReturnObject &result) |
void | SetOriginalCommandString (std::string s) |
Set the command input as it appeared in the terminal. |
Protected Member Functions | |
bool | IsNestedAlias () |
Protected Member Functions inherited from lldb_private::CommandObject | |
bool | ParseOptionsAndNotify (Args &args, CommandReturnObject &result, OptionGroupOptions &group_options, ExecutionContext &exe_ctx) |
virtual const char * | GetInvalidTargetDescription () |
virtual const char * | GetInvalidProcessDescription () |
virtual const char * | GetInvalidThreadDescription () |
virtual const char * | GetInvalidFrameDescription () |
virtual const char * | GetInvalidRegContextDescription () |
Target & | GetDummyTarget () |
Target & | GetTarget () |
Thread * | GetDefaultThread () |
bool | CheckRequirements (CommandReturnObject &result) |
Check the command to make sure anything required by this command is available. | |
void | Cleanup () |
Private Attributes | |
lldb::CommandObjectSP | m_underlying_command_sp |
std::string | m_option_string |
OptionArgVectorSP | m_option_args_sp |
LazyBool | m_is_dashdash_alias |
bool | m_did_set_help: 1 |
bool | m_did_set_help_long: 1 |
Definition at line 20 of file CommandAlias.h.
typedef std::unique_ptr<CommandAlias> lldb_private::CommandAlias::UniquePointer |
Definition at line 22 of file CommandAlias.h.
CommandAlias::CommandAlias | ( | CommandInterpreter & | interpreter, |
lldb::CommandObjectSP | cmd_sp, | ||
llvm::StringRef | options_args, | ||
llvm::StringRef | name, | ||
llvm::StringRef | help = llvm::StringRef(), | ||
llvm::StringRef | syntax = llvm::StringRef(), | ||
uint32_t | flags = 0 ) |
Definition at line 72 of file CommandAlias.cpp.
References lldb_private::CommandObject::CommandObject(), lldb_private::eLazyBoolCalculate, error(), GetAliasExpansion(), lldb_private::StreamString::GetData(), GetHelp(), lldb_private::GetLog(), lldb_private::StreamString::GetString(), GetUnderlyingCommand(), lldb_private::Host, LLDB_LOG_ERROR, lldb_private::CommandObject::m_arguments, m_did_set_help, m_did_set_help_long, m_is_dashdash_alias, m_option_args_sp, m_option_string, m_underlying_command_sp, lldb_private::Stream::Printf(), ProcessAliasOptionsArgs(), and SetHelp().
Referenced by Desugar().
std::pair< lldb::CommandObjectSP, OptionArgVectorSP > CommandAlias::Desugar | ( | ) |
Definition at line 205 of file CommandAlias.cpp.
References CommandAlias(), GetOptionArguments(), and GetUnderlyingCommand().
|
overridevirtual |
offset_in_command | is on what column args_string appears, if applicable. This enables diagnostics that refer back to the user input. |
Implements lldb_private::CommandObject.
Definition at line 137 of file CommandAlias.cpp.
void CommandAlias::GetAliasExpansion | ( | StreamString & | help_string | ) | const |
Definition at line 142 of file CommandAlias.cpp.
References lldb_private::CommandInterpreter::g_argument, lldb_private::CommandInterpreter::g_need_argument, lldb_private::CommandInterpreter::g_no_argument, m_option_args_sp, m_underlying_command_sp, and lldb_private::Stream::Printf().
Referenced by CommandAlias().
|
overridevirtual |
Reimplemented from lldb_private::CommandObject.
Definition at line 235 of file CommandAlias.cpp.
References IsValid(), lldb_private::CommandObject::m_cmd_help_short, m_did_set_help, and m_underlying_command_sp.
Referenced by CommandAlias().
|
overridevirtual |
Reimplemented from lldb_private::CommandObject.
Definition at line 243 of file CommandAlias.cpp.
References IsValid(), lldb_private::CommandObject::m_cmd_help_long, m_did_set_help_long, and m_underlying_command_sp.
|
inline |
Definition at line 64 of file CommandAlias.h.
References m_option_args_sp.
Referenced by lldb_private::CommandInterpreter::BuildAliasCommandArgs(), Desugar(), and IsDashDashCommand().
|
overridevirtual |
Reimplemented from lldb_private::CommandObject.
Definition at line 131 of file CommandAlias.cpp.
References IsValid(), and m_underlying_command_sp.
|
inline |
Definition at line 65 of file CommandAlias.h.
References m_option_string.
|
inline |
Definition at line 61 of file CommandAlias.h.
References m_underlying_command_sp.
Referenced by CommandAlias(), Desugar(), IsDashDashCommand(), and IsNestedAlias().
|
overridevirtual |
The default version handles argument definitions that have only one argument type, and use one of the argument types that have an entry in the CommonCompletions.
Override this if you have a more complex argument setup. FIXME: we should be able to extend this to more complex argument definitions provided we have completers for all the argument types.
The input array contains a parsed version of the line.
We've constructed the map of options and their arguments as well if that is helpful for the completion.
[in,out] | request | The completion request that needs to be answered. |
Reimplemented from lldb_private::CommandObject.
Definition at line 124 of file CommandAlias.cpp.
References IsValid(), and m_underlying_command_sp.
|
overridevirtual |
This default version handles calling option argument completions and then calls HandleArgumentCompletion if the cursor is on an argument, not an option.
Don't override this method, override HandleArgumentCompletion instead unless you have special reasons.
[in,out] | request | The completion request that needs to be answered. |
Reimplemented from lldb_private::CommandObject.
Definition at line 119 of file CommandAlias.cpp.
References IsValid(), and m_underlying_command_sp.
|
inlineoverridevirtual |
Reimplemented from lldb_private::CommandObject.
Definition at line 47 of file CommandAlias.h.
|
overridevirtual |
Reimplemented from lldb_private::CommandObject.
Definition at line 171 of file CommandAlias.cpp.
References lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, lldb_private::CommandInterpreter::g_argument, GetOptionArguments(), GetUnderlyingCommand(), IsNestedAlias(), IsValid(), and m_is_dashdash_alias.
|
protected |
Definition at line 199 of file CommandAlias.cpp.
References GetUnderlyingCommand().
Referenced by IsDashDashCommand().
|
inline |
Definition at line 31 of file CommandAlias.h.
References m_option_args_sp, and m_underlying_command_sp.
Referenced by GetHelp(), GetHelpLong(), GetOptions(), HandleArgumentCompletion(), HandleCompletion(), IsDashDashCommand(), operator bool(), WantsCompletion(), and WantsRawCommandString().
|
inlineexplicit |
Definition at line 33 of file CommandAlias.h.
References IsValid().
|
overridevirtual |
Reimplemented from lldb_private::CommandObject.
Definition at line 225 of file CommandAlias.cpp.
References m_did_set_help, and lldb_private::CommandObject::SetHelp().
Referenced by CommandAlias(), and lldb_private::CommandInterpreter::Initialize().
|
overridevirtual |
Reimplemented from lldb_private::CommandObject.
Definition at line 230 of file CommandAlias.cpp.
References m_did_set_help_long, and lldb_private::CommandObject::SetHelpLong().
Referenced by lldb_private::CommandInterpreter::Initialize().
|
overridevirtual |
Reimplemented from lldb_private::CommandObject.
Definition at line 113 of file CommandAlias.cpp.
References IsValid(), and m_underlying_command_sp.
|
overridevirtual |
Implements lldb_private::CommandObject.
Definition at line 107 of file CommandAlias.cpp.
References IsValid(), and m_underlying_command_sp.
|
private |
Definition at line 79 of file CommandAlias.h.
Referenced by CommandAlias(), GetHelp(), and SetHelp().
|
private |
Definition at line 80 of file CommandAlias.h.
Referenced by CommandAlias(), GetHelpLong(), and SetHelpLong().
|
private |
Definition at line 78 of file CommandAlias.h.
Referenced by CommandAlias(), and IsDashDashCommand().
|
private |
Definition at line 77 of file CommandAlias.h.
Referenced by CommandAlias(), GetAliasExpansion(), GetOptionArguments(), and IsValid().
|
private |
Definition at line 76 of file CommandAlias.h.
Referenced by CommandAlias(), and GetOptionString().
|
private |
Definition at line 75 of file CommandAlias.h.
Referenced by CommandAlias(), GetAliasExpansion(), GetHelp(), GetHelpLong(), GetOptions(), GetUnderlyingCommand(), HandleArgumentCompletion(), HandleCompletion(), IsValid(), WantsCompletion(), and WantsRawCommandString().