LLDB
mainline
|
#include <CommandInterpreter.h>
Public Types | |
enum | { eBroadcastBitThreadShouldExit = (1 << 0), eBroadcastBitResetPrompt = (1 << 1), eBroadcastBitQuitCommandReceived = (1 << 2), eBroadcastBitAsynchronousOutputData = (1 << 3), eBroadcastBitAsynchronousErrorData = (1 << 4) } |
enum | ChildrenOmissionWarningStatus { eNoOmission = 0, eUnwarnedOmission = 1, eWarnedOmission = 2 } |
Tristate boolean to manage children omission warnings. More... | |
enum | CommandTypes { eCommandTypesBuiltin = 0x0001, eCommandTypesUserDef = 0x0002, eCommandTypesUserMW = 0x0004, eCommandTypesAliases = 0x0008, eCommandTypesHidden = 0x0010, eCommandTypesAllThem = 0xFFFF } |
![]() | |
enum | Completion { Completion::None, Completion::LLDBCommand, Completion::Expression } |
Public Member Functions | |
CommandInterpreter (Debugger &debugger, bool synchronous_execution) | |
~CommandInterpreter () override=default | |
ConstString & | GetBroadcasterClass () const override |
This needs to be filled in if you are going to register the broadcaster with the broadcaster manager and do broadcaster class matching. More... | |
void | SourceInitFileCwd (CommandReturnObject &result) |
void | SourceInitFileHome (CommandReturnObject &result, bool is_repl) |
void | SourceInitFileGlobal (CommandReturnObject &result) |
bool | AddCommand (llvm::StringRef name, const lldb::CommandObjectSP &cmd_sp, bool can_replace) |
Status | AddUserCommand (llvm::StringRef name, const lldb::CommandObjectSP &cmd_sp, bool can_replace) |
lldb::CommandObjectSP | GetCommandSPExact (llvm::StringRef cmd, bool include_aliases=false) const |
CommandObject * | GetCommandObject (llvm::StringRef cmd, StringList *matches=nullptr, StringList *descriptions=nullptr) const |
CommandObject * | GetUserCommandObject (llvm::StringRef cmd, StringList *matches=nullptr, StringList *descriptions=nullptr) const |
bool | CommandExists (llvm::StringRef cmd) const |
Determine whether a root level, built-in command with this name exists. More... | |
bool | AliasExists (llvm::StringRef cmd) const |
Determine whether an alias command with this name exists. More... | |
bool | UserCommandExists (llvm::StringRef cmd) const |
Determine whether a root-level user command with this name exists. More... | |
bool | UserMultiwordCommandExists (llvm::StringRef cmd) const |
Determine whether a root-level user multiword command with this name exists. More... | |
CommandObjectMultiword * | VerifyUserMultiwordCmdPath (Args &path, bool leaf_is_command, Status &result) |
Look up the command pointed to by path encoded in the arguments of the incoming command object. More... | |
CommandAlias * | AddAlias (llvm::StringRef alias_name, lldb::CommandObjectSP &command_obj_sp, llvm::StringRef args_string=llvm::StringRef()) |
bool | RemoveCommand (llvm::StringRef cmd) |
bool | RemoveAlias (llvm::StringRef alias_name) |
bool | GetAliasFullName (llvm::StringRef cmd, std::string &full_name) const |
bool | RemoveUserMultiword (llvm::StringRef multiword_name) |
void | RemoveAllUserMultiword () |
bool | RemoveUser (llvm::StringRef alias_name) |
void | RemoveAllUser () |
const CommandAlias * | GetAlias (llvm::StringRef alias_name) const |
CommandObject * | BuildAliasResult (llvm::StringRef alias_name, std::string &raw_input_string, std::string &alias_result, CommandReturnObject &result) |
bool | HandleCommand (const char *command_line, LazyBool add_to_history, const ExecutionContext &override_context, CommandReturnObject &result) |
bool | HandleCommand (const char *command_line, LazyBool add_to_history, CommandReturnObject &result) |
bool | WasInterrupted () const |
void | HandleCommands (const StringList &commands, const ExecutionContext &context, const CommandInterpreterRunOptions &options, CommandReturnObject &result) |
Execute a list of commands in sequence. More... | |
void | HandleCommands (const StringList &commands, const CommandInterpreterRunOptions &options, CommandReturnObject &result) |
void | HandleCommandsFromFile (FileSpec &file, const ExecutionContext &context, const CommandInterpreterRunOptions &options, CommandReturnObject &result) |
Execute a list of commands from a file. More... | |
void | HandleCommandsFromFile (FileSpec &file, const CommandInterpreterRunOptions &options, CommandReturnObject &result) |
CommandObject * | GetCommandObjectForCommand (llvm::StringRef &command_line) |
std::optional< std::string > | GetAutoSuggestionForCommand (llvm::StringRef line) |
Returns the auto-suggestion string that should be added to the given command line. More... | |
void | HandleCompletion (CompletionRequest &request) |
void | HandleCompletionMatches (CompletionRequest &request) |
int | GetCommandNamesMatchingPartialString (const char *cmd_cstr, bool include_aliases, StringList &matches, StringList &descriptions) |
void | GetHelp (CommandReturnObject &result, uint32_t types=eCommandTypesAllThem) |
void | GetAliasHelp (const char *alias_name, StreamString &help_string) |
void | OutputFormattedHelpText (Stream &strm, llvm::StringRef prefix, llvm::StringRef help_text) |
void | OutputFormattedHelpText (Stream &stream, llvm::StringRef command_word, llvm::StringRef separator, llvm::StringRef help_text, size_t max_word_len) |
void | OutputHelpText (Stream &stream, llvm::StringRef command_word, llvm::StringRef separator, llvm::StringRef help_text, uint32_t max_word_len) |
Debugger & | GetDebugger () |
ExecutionContext | GetExecutionContext () const |
lldb::PlatformSP | GetPlatform (bool prefer_target_platform) |
const char * | ProcessEmbeddedScriptCommands (const char *arg) |
void | UpdatePrompt (llvm::StringRef prompt) |
bool | Confirm (llvm::StringRef message, bool default_answer) |
void | LoadCommandDictionary () |
void | Initialize () |
void | Clear () |
bool | HasCommands () const |
bool | HasAliases () const |
bool | HasUserCommands () const |
bool | HasUserMultiwordCommands () const |
bool | HasAliasOptions () const |
void | BuildAliasCommandArgs (CommandObject *alias_cmd_obj, const char *alias_name, Args &cmd_args, std::string &raw_input_string, CommandReturnObject &result) |
int | GetOptionArgumentPosition (const char *in_string) |
Picks the number out of a string of the form "%NNN", otherwise return 0. More... | |
void | SkipLLDBInitFiles (bool skip_lldbinit_files) |
void | SkipAppInitFiles (bool skip_app_init_files) |
bool | GetSynchronous () |
void | FindCommandsForApropos (llvm::StringRef word, StringList &commands_found, StringList &commands_help, bool search_builtin_commands, bool search_user_commands, bool search_alias_commands, bool search_user_mw_commands) |
bool | GetBatchCommandMode () |
bool | SetBatchCommandMode (bool value) |
void | ChildrenTruncated () |
void | SetReachedMaximumDepth () |
void | PrintWarningsIfNecessary (Stream &s, const std::string &cmd_name) |
CommandHistory & | GetCommandHistory () |
bool | IsActive () |
CommandInterpreterRunResult | RunCommandInterpreter (CommandInterpreterRunOptions &options) |
void | GetLLDBCommandsFromIOHandler (const char *prompt, IOHandlerDelegate &delegate, void *baton=nullptr) |
void | GetPythonCommandsFromIOHandler (const char *prompt, IOHandlerDelegate &delegate, void *baton=nullptr) |
const char * | GetCommandPrefix () |
bool | GetExpandRegexAliases () const |
bool | GetPromptOnQuit () const |
void | SetPromptOnQuit (bool enable) |
bool | GetSaveSessionOnQuit () const |
void | SetSaveSessionOnQuit (bool enable) |
bool | GetOpenTranscriptInEditor () const |
void | SetOpenTranscriptInEditor (bool enable) |
FileSpec | GetSaveSessionDirectory () const |
void | SetSaveSessionDirectory (llvm::StringRef path) |
bool | GetEchoCommands () const |
void | SetEchoCommands (bool enable) |
bool | GetEchoCommentCommands () const |
void | SetEchoCommentCommands (bool enable) |
bool | GetRepeatPreviousCommand () const |
bool | GetRequireCommandOverwrite () const |
const CommandObject::CommandMap & | GetUserCommands () const |
const CommandObject::CommandMap & | GetUserMultiwordCommands () const |
const CommandObject::CommandMap & | GetCommands () const |
const CommandObject::CommandMap & | GetAliases () const |
void | AllowExitCodeOnQuit (bool allow) |
Specify if the command interpreter should allow that the user can specify a custom exit code when calling 'quit'. More... | |
bool | SetQuitExitCode (int exit_code) |
Sets the exit code for the quit command. More... | |
int | GetQuitExitCode (bool &exited) const |
Returns the exit code that the user has specified when running the 'quit' command. More... | |
void | ResolveCommand (const char *command_line, CommandReturnObject &result) |
bool | GetStopCmdSourceOnError () const |
lldb::IOHandlerSP | GetIOHandler (bool force_create=false, CommandInterpreterRunOptions *options=nullptr) |
bool | GetSpaceReplPrompts () const |
bool | SaveTranscript (CommandReturnObject &result, std::optional< std::string > output_file=std::nullopt) |
Save the current debugger session transcript to a file on disk. More... | |
FileSpec | GetCurrentSourceDir () |
bool | IsInteractive () |
bool | IOHandlerInterrupt (IOHandler &io_handler) override |
![]() | |
Broadcaster (lldb::BroadcasterManagerSP manager_sp, const char *name) | |
Construct with a broadcaster with a name. More... | |
virtual | ~Broadcaster () |
Destructor. More... | |
void | CheckInWithManager () |
void | BroadcastEvent (lldb::EventSP &event_sp) |
Broadcast an event which has no associated data. More... | |
void | BroadcastEventIfUnique (lldb::EventSP &event_sp) |
void | BroadcastEvent (uint32_t event_type, const lldb::EventDataSP &event_data_sp) |
void | BroadcastEvent (uint32_t event_type, EventData *event_data=nullptr) |
void | BroadcastEventIfUnique (uint32_t event_type, EventData *event_data=nullptr) |
void | Clear () |
virtual void | AddInitialEventsToListener (const lldb::ListenerSP &listener_sp, uint32_t requested_events) |
uint32_t | AddListener (const lldb::ListenerSP &listener_sp, uint32_t event_mask) |
Listen for any events specified by event_mask. More... | |
ConstString | GetBroadcasterName () |
Get the NULL terminated C string name of this Broadcaster object. More... | |
bool | GetEventNames (Stream &s, const uint32_t event_mask, bool prefix_with_broadcaster_name) const |
Get the event name(s) for one or more event bits. More... | |
void | SetEventName (uint32_t event_mask, const char *name) |
Set the name for an event bit. More... | |
const char * | GetEventName (uint32_t event_mask) const |
bool | EventTypeHasListeners (uint32_t event_type) |
bool | RemoveListener (const lldb::ListenerSP &listener_sp, uint32_t event_mask=UINT32_MAX) |
Removes a Listener from this broadcasters list and frees the event bits specified by event_mask that were previously acquired by listener (assuming listener was listening to this object) for other listener objects to use. More... | |
bool | HijackBroadcaster (const lldb::ListenerSP &listener_sp, uint32_t event_mask=UINT32_MAX) |
Provides a simple mechanism to temporarily redirect events from broadcaster. More... | |
bool | IsHijackedForEvent (uint32_t event_mask) |
void | RestoreBroadcaster () |
Restore the state of the Broadcaster from a previous hijack attempt. More... | |
lldb::BroadcasterManagerSP | GetManager () |
![]() | |
Properties ()=default | |
Properties (const lldb::OptionValuePropertiesSP &collection_sp) | |
virtual | ~Properties ()=default |
virtual lldb::OptionValuePropertiesSP | GetValueProperties () const |
virtual lldb::OptionValueSP | GetPropertyValue (const ExecutionContext *exe_ctx, llvm::StringRef property_path, bool will_modify, Status &error) const |
virtual Status | SetPropertyValue (const ExecutionContext *exe_ctx, VarSetOperationType op, llvm::StringRef property_path, llvm::StringRef value) |
virtual Status | DumpPropertyValue (const ExecutionContext *exe_ctx, Stream &strm, llvm::StringRef property_path, uint32_t dump_mask, bool is_json=false) |
virtual void | DumpAllPropertyValues (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask, bool is_json=false) |
virtual void | DumpAllDescriptions (CommandInterpreter &interpreter, Stream &strm) const |
size_t | Apropos (llvm::StringRef keyword, std::vector< const Property * > &matching_properties) const |
lldb::OptionValuePropertiesSP | GetSubProperty (const ExecutionContext *exe_ctx, ConstString name) |
![]() | |
IOHandlerDelegate (Completion completion=Completion::None) | |
virtual | ~IOHandlerDelegate ()=default |
virtual void | IOHandlerActivated (IOHandler &io_handler, bool interactive) |
virtual void | IOHandlerDeactivated (IOHandler &io_handler) |
virtual std::optional< std::string > | IOHandlerSuggestion (IOHandler &io_handler, llvm::StringRef line) |
virtual void | IOHandlerComplete (IOHandler &io_handler, CompletionRequest &request) |
virtual const char * | IOHandlerGetFixIndentationCharacters () |
virtual int | IOHandlerFixIndentation (IOHandler &io_handler, const StringList &lines, int cursor_position) |
Called when a new line is created or one of an identified set of indentation characters is typed. More... | |
virtual void | IOHandlerInputInterrupted (IOHandler &io_handler, std::string &data) |
virtual bool | IOHandlerIsInputComplete (IOHandler &io_handler, StringList &lines) |
Called to determine whether typing enter after the last line in lines should end input. More... | |
virtual const char * | IOHandlerGetCommandPrefix () |
virtual const char * | IOHandlerGetHelpPrologue () |
Static Public Member Functions | |
static ConstString & | GetStaticBroadcasterClass () |
![]() | |
static const char * | GetExperimentalSettingsName () |
static bool | IsSettingExperimental (llvm::StringRef setting) |
Static Public Attributes | |
static const char * | g_no_argument = "<no-argument>" |
static const char * | g_need_argument = "<need-argument>" |
static const char * | g_argument = "<argument>" |
Protected Member Functions | |
void | IOHandlerInputComplete (IOHandler &io_handler, std::string &line) override |
Called when a line or lines have been retrieved. More... | |
ConstString | IOHandlerGetControlSequence (char ch) override |
void | GetProcessOutput () |
bool | DidProcessStopAbnormally () const |
void | SetSynchronous (bool value) |
lldb::CommandObjectSP | GetCommandSP (llvm::StringRef cmd, bool include_aliases=true, bool exact=true, StringList *matches=nullptr, StringList *descriptions=nullptr) const |
![]() | |
BroadcasterImplSP | GetBroadcasterImpl () |
const char * | GetHijackingListenerName () |
Private Types | |
enum | CommandHandlingState { CommandHandlingState::eIdle, CommandHandlingState::eInProgress, CommandHandlingState::eInterrupted } |
Private Member Functions | |
void | OverrideExecutionContext (const ExecutionContext &override_context) |
void | RestoreExecutionContext () |
Status | PreprocessCommand (std::string &command) |
void | SourceInitFile (FileSpec file, CommandReturnObject &result) |
CommandObject * | ResolveCommandImpl (std::string &command_line, CommandReturnObject &result) |
void | FindCommandsForApropos (llvm::StringRef word, StringList &commands_found, StringList &commands_help, const CommandObject::CommandMap &command_map) |
void | PrintCommandOutput (IOHandler &io_handler, llvm::StringRef str, bool is_stdout) |
bool | EchoCommandNonInteractive (llvm::StringRef line, const Flags &io_handler_flags) const |
void | StartHandlingCommand () |
void | FinishHandlingCommand () |
bool | InterruptCommand () |
Friends | |
class | Debugger |
Additional Inherited Members | |
![]() | |
typedef std::shared_ptr< BroadcasterImpl > | BroadcasterImplSP |
typedef std::weak_ptr< BroadcasterImpl > | BroadcasterImplWP |
![]() | |
lldb::OptionValuePropertiesSP | m_collection_sp |
![]() | |
Completion | m_completion |
Definition at line 215 of file CommandInterpreter.h.
anonymous enum |
Enumerator | |
---|---|
eBroadcastBitThreadShouldExit | |
eBroadcastBitResetPrompt | |
eBroadcastBitQuitCommandReceived | |
eBroadcastBitAsynchronousOutputData | |
eBroadcastBitAsynchronousErrorData |
Definition at line 219 of file CommandInterpreter.h.
Tristate boolean to manage children omission warnings.
Enumerator | |
---|---|
eNoOmission | No children were omitted. |
eUnwarnedOmission | Children omitted, and not yet notified. |
eWarnedOmission | Children omitted and notified. |
Definition at line 228 of file CommandInterpreter.h.
|
strongprivate |
Enumerator | |
---|---|
eIdle | |
eInProgress | |
eInterrupted |
Definition at line 691 of file CommandInterpreter.h.
Enumerator | |
---|---|
eCommandTypesBuiltin | |
eCommandTypesUserDef | |
eCommandTypesUserMW | |
eCommandTypesAliases | |
eCommandTypesHidden | |
eCommandTypesAllThem |
Definition at line 234 of file CommandInterpreter.h.
CommandInterpreter::CommandInterpreter | ( | Debugger & | debugger, |
bool | synchronous_execution | ||
) |
Definition at line 127 of file CommandInterpreter.cpp.
References lldb_private::Broadcaster::CheckInWithManager(), eBroadcastBitQuitCommandReceived, eBroadcastBitResetPrompt, eBroadcastBitThreadShouldExit, lldb_private::Properties::m_collection_sp, lldb_private::Broadcaster::SetEventName(), and SetSynchronous().
|
overridedefault |
CommandAlias* lldb_private::CommandInterpreter::AddAlias | ( | llvm::StringRef | alias_name, |
lldb::CommandObjectSP & | command_obj_sp, | ||
llvm::StringRef | args_string = llvm::StringRef() |
||
) |
Referenced by Initialize().
bool lldb_private::CommandInterpreter::AddCommand | ( | llvm::StringRef | name, |
const lldb::CommandObjectSP & | cmd_sp, | ||
bool | can_replace | ||
) |
Status lldb_private::CommandInterpreter::AddUserCommand | ( | llvm::StringRef | name, |
const lldb::CommandObjectSP & | cmd_sp, | ||
bool | can_replace | ||
) |
bool lldb_private::CommandInterpreter::AliasExists | ( | llvm::StringRef | cmd | ) | const |
Determine whether an alias command with this name exists.
Referenced by lldb::SBCommandInterpreter::AliasExists().
void CommandInterpreter::AllowExitCodeOnQuit | ( | bool | allow | ) |
Specify if the command interpreter should allow that the user can specify a custom exit code when calling 'quit'.
Definition at line 218 of file CommandInterpreter.cpp.
References m_allow_exit_code, and m_quit_exit_code.
Referenced by lldb::SBCommandInterpreter::AllowExitCodeOnQuit().
void lldb_private::CommandInterpreter::BuildAliasCommandArgs | ( | CommandObject * | alias_cmd_obj, |
const char * | alias_name, | ||
Args & | cmd_args, | ||
std::string & | raw_input_string, | ||
CommandReturnObject & | result | ||
) |
CommandObject* lldb_private::CommandInterpreter::BuildAliasResult | ( | llvm::StringRef | alias_name, |
std::string & | raw_input_string, | ||
std::string & | alias_result, | ||
CommandReturnObject & | result | ||
) |
|
inline |
Definition at line 507 of file CommandInterpreter.h.
References eNoOmission, eUnwarnedOmission, and m_truncation_warning.
void CommandInterpreter::Clear | ( | ) |
Definition at line 509 of file CommandInterpreter.cpp.
References m_command_io_handler_sp.
bool lldb_private::CommandInterpreter::CommandExists | ( | llvm::StringRef | cmd | ) | const |
Determine whether a root level, built-in command with this name exists.
Referenced by lldb::SBCommandInterpreter::CommandExists().
bool lldb_private::CommandInterpreter::Confirm | ( | llvm::StringRef | message, |
bool | default_answer | ||
) |
Referenced by lldb_private::CommandObjectQuit::DoExecute().
|
protected |
|
private |
void lldb_private::CommandInterpreter::FindCommandsForApropos | ( | llvm::StringRef | word, |
StringList & | commands_found, | ||
StringList & | commands_help, | ||
bool | search_builtin_commands, | ||
bool | search_user_commands, | ||
bool | search_alias_commands, | ||
bool | search_user_mw_commands | ||
) |
Referenced by lldb_private::CommandObjectApropos::DoExecute().
|
private |
|
private |
const CommandAlias* lldb_private::CommandInterpreter::GetAlias | ( | llvm::StringRef | alias_name | ) | const |
Referenced by lldb_private::CommandObjectHelp::DoExecute().
|
inline |
Definition at line 591 of file CommandInterpreter.h.
References m_alias_dict.
bool lldb_private::CommandInterpreter::GetAliasFullName | ( | llvm::StringRef | cmd, |
std::string & | full_name | ||
) | const |
Referenced by lldb_private::CommandObjectHelp::DoExecute().
void lldb_private::CommandInterpreter::GetAliasHelp | ( | const char * | alias_name, |
StreamString & | help_string | ||
) |
std::optional<std::string> lldb_private::CommandInterpreter::GetAutoSuggestionForCommand | ( | llvm::StringRef | line | ) |
Returns the auto-suggestion string that should be added to the given command line.
Referenced by lldb_private::IOHandlerDelegate::IOHandlerSuggestion().
|
inline |
Definition at line 499 of file CommandInterpreter.h.
References m_batch_command_mode.
|
inlineoverridevirtual |
This needs to be filled in if you are going to register the broadcaster with the broadcaster manager and do broadcaster class matching.
FIXME: Probably should make a ManagedBroadcaster subclass with all the bits needed to work with the BroadcasterManager, so that it is clearer how to add one.
Reimplemented from lldb_private::Broadcaster.
Definition at line 259 of file CommandInterpreter.h.
References GetStaticBroadcasterClass().
|
inline |
Definition at line 537 of file CommandInterpreter.h.
References m_command_history.
int lldb_private::CommandInterpreter::GetCommandNamesMatchingPartialString | ( | const char * | cmd_cstr, |
bool | include_aliases, | ||
StringList & | matches, | ||
StringList & | descriptions | ||
) |
CommandObject* lldb_private::CommandInterpreter::GetCommandObject | ( | llvm::StringRef | cmd, |
StringList * | matches = nullptr , |
||
StringList * | descriptions = nullptr |
||
) | const |
CommandObject* lldb_private::CommandInterpreter::GetCommandObjectForCommand | ( | llvm::StringRef & | command_line | ) |
const char* lldb_private::CommandInterpreter::GetCommandPrefix | ( | ) |
Referenced by lldb_private::CommandObjectHelp::DoExecute().
|
inline |
Definition at line 587 of file CommandInterpreter.h.
References m_command_dict.
|
protected |
lldb::CommandObjectSP lldb_private::CommandInterpreter::GetCommandSPExact | ( | llvm::StringRef | cmd, |
bool | include_aliases = false |
||
) | const |
Referenced by Initialize().
FileSpec lldb_private::CommandInterpreter::GetCurrentSourceDir | ( | ) |
|
inline |
Definition at line 446 of file CommandInterpreter.h.
References m_debugger.
Referenced by lldb_private::CommandCompletions::BreakpointNames(), lldb_private::CommandCompletions::Breakpoints(), lldb_private::OptionGroupPlatform::CreatePlatformWithOptions(), lldb_private::CommandObjectScript::DoExecute(), lldb_private::CommandObjectDisassemble::DoExecute(), lldb::SBCommandInterpreter::GetDebugger(), lldb_private::CommandObject::GetDebugger(), lldb_private::CommandObject::GetDefaultThread(), lldb_private::CommandObject::GetDummyTarget(), lldb::SBCommandInterpreter::GetIOHandlerControlSequence(), lldb::SBCommandInterpreter::GetProcess(), lldb_private::CommandObject::GetSelectedOrDummyTarget(), lldb_private::CommandObject::GetSelectedTarget(), lldb_private::CommandObject::HandleCompletion(), lldb_private::Options::HandleOptionArgumentCompletion(), lldb_private::CommandCompletions::Modules(), lldb_private::CommandCompletions::RemoteDiskDirectories(), lldb_private::CommandCompletions::RemoteDiskFiles(), sddarwinlog_private::RunEnableCommand(), lldb_private::CommandCompletions::SettingsNames(), lldb_private::CommandCompletions::SourceFiles(), lldb::SBCommandInterpreter::SourceInitFileInCurrentWorkingDirectory(), lldb::SBCommandInterpreter::SourceInitFileInGlobalDirectory(), lldb::SBCommandInterpreter::SourceInitFileInHomeDirectory(), and lldb_private::CommandCompletions::Symbols().
bool CommandInterpreter::GetEchoCommands | ( | ) | const |
Definition at line 196 of file CommandInterpreter.cpp.
References lldb_private::Properties::m_collection_sp.
bool CommandInterpreter::GetEchoCommentCommands | ( | ) | const |
Definition at line 207 of file CommandInterpreter.cpp.
References lldb_private::Properties::m_collection_sp.
ExecutionContext lldb_private::CommandInterpreter::GetExecutionContext | ( | ) | const |
Referenced by lldb_private::OptionValueUUID::AutoComplete(), lldb_private::CommandObject::CheckRequirements(), CommandObjectProcessKDPPacketSend::DoExecute(), lldb_private::CommandObjectTraceProxy::DoGetProxyCommandObject(), DumpCompileUnitLineTable(), DumpModuleSections(), DumpModuleSymtab(), lldb_private::CommandCompletions::FrameIndexes(), lldb_private::CommandObject::HandleCompletion(), LookupAddressInModule(), LookupFileAndLineInModule(), LookupFunctionInModule(), LookupSymbolInModule(), lldb_private::CommandCompletions::ModuleUUIDs(), lldb_private::CommandObject::ParseOptions(), lldb_private::CommandCompletions::Registers(), lldb_private::REPL::REPL(), lldb_private::CommandCompletions::StopHookIDs(), lldb_private::CommandCompletions::ThreadIndexes(), lldb_private::CommandCompletions::VariablePath(), and lldb_private::CommandCompletions::WatchPointIDs().
bool CommandInterpreter::GetExpandRegexAliases | ( | ) | const |
Definition at line 147 of file CommandInterpreter.cpp.
References lldb_private::Properties::m_collection_sp.
Referenced by lldb_private::CommandObjectRegexCommand::DoExecute().
void lldb_private::CommandInterpreter::GetHelp | ( | CommandReturnObject & | result, |
uint32_t | types = eCommandTypesAllThem |
||
) |
Referenced by lldb_private::CommandObjectHelp::DoExecute().
lldb::IOHandlerSP lldb_private::CommandInterpreter::GetIOHandler | ( | bool | force_create = false , |
CommandInterpreterRunOptions * | options = nullptr |
||
) |
Referenced by lldb_private::REPL::IOHandlerInputComplete().
void lldb_private::CommandInterpreter::GetLLDBCommandsFromIOHandler | ( | const char * | prompt, |
IOHandlerDelegate & | delegate, | ||
void * | baton = nullptr |
||
) |
bool CommandInterpreter::GetOpenTranscriptInEditor | ( | ) | const |
Definition at line 175 of file CommandInterpreter.cpp.
References lldb_private::Properties::m_collection_sp.
int lldb_private::CommandInterpreter::GetOptionArgumentPosition | ( | const char * | in_string | ) |
Picks the number out of a string of the form "%NNN", otherwise return 0.
lldb::PlatformSP lldb_private::CommandInterpreter::GetPlatform | ( | bool | prefer_target_platform | ) |
|
protected |
bool CommandInterpreter::GetPromptOnQuit | ( | ) | const |
Definition at line 153 of file CommandInterpreter.cpp.
References lldb_private::Properties::m_collection_sp.
Referenced by lldb::SBCommandInterpreter::GetPromptOnQuit(), lldb_private::REPL::IOHandlerInputComplete(), and lldb_private::CommandObjectQuit::ShouldAskForConfirmation().
void lldb_private::CommandInterpreter::GetPythonCommandsFromIOHandler | ( | const char * | prompt, |
IOHandlerDelegate & | delegate, | ||
void * | baton = nullptr |
||
) |
int CommandInterpreter::GetQuitExitCode | ( | bool & | exited | ) | const |
Returns the exit code that the user has specified when running the 'quit' command.
[out] | exited | Set to true if the user has called quit with a custom exit code. |
Definition at line 231 of file CommandInterpreter.cpp.
References m_quit_exit_code.
Referenced by lldb::SBCommandInterpreter::GetQuitStatus(), and lldb::SBCommandInterpreter::HasCustomQuitExitCode().
bool CommandInterpreter::GetRepeatPreviousCommand | ( | ) | const |
Definition at line 259 of file CommandInterpreter.cpp.
References lldb_private::Properties::m_collection_sp.
bool CommandInterpreter::GetRequireCommandOverwrite | ( | ) | const |
Definition at line 265 of file CommandInterpreter.cpp.
References lldb_private::Properties::m_collection_sp.
FileSpec CommandInterpreter::GetSaveSessionDirectory | ( | ) | const |
Definition at line 186 of file CommandInterpreter.cpp.
References lldb_private::Properties::m_collection_sp.
bool CommandInterpreter::GetSaveSessionOnQuit | ( | ) | const |
Definition at line 164 of file CommandInterpreter.cpp.
References lldb_private::Properties::m_collection_sp.
Referenced by lldb_private::Debugger::Destroy().
bool CommandInterpreter::GetSpaceReplPrompts | ( | ) | const |
Definition at line 253 of file CommandInterpreter.cpp.
References lldb_private::Properties::m_collection_sp.
Referenced by lldb_private::REPL::IOHandlerInputComplete().
|
static |
Definition at line 122 of file CommandInterpreter.cpp.
Referenced by GetBroadcasterClass().
bool CommandInterpreter::GetStopCmdSourceOnError | ( | ) | const |
Definition at line 247 of file CommandInterpreter.cpp.
References lldb_private::Properties::m_collection_sp.
bool lldb_private::CommandInterpreter::GetSynchronous | ( | ) |
Referenced by lldb_private::Target::Launch().
CommandObject* lldb_private::CommandInterpreter::GetUserCommandObject | ( | llvm::StringRef | cmd, |
StringList * | matches = nullptr , |
||
StringList * | descriptions = nullptr |
||
) | const |
|
inline |
Definition at line 579 of file CommandInterpreter.h.
References m_user_dict.
|
inline |
Definition at line 583 of file CommandInterpreter.h.
References m_user_mw_dict.
bool lldb_private::CommandInterpreter::HandleCommand | ( | const char * | command_line, |
LazyBool | add_to_history, | ||
CommandReturnObject & | result | ||
) |
bool lldb_private::CommandInterpreter::HandleCommand | ( | const char * | command_line, |
LazyBool | add_to_history, | ||
const ExecutionContext & | override_context, | ||
CommandReturnObject & | result | ||
) |
void lldb_private::CommandInterpreter::HandleCommands | ( | const StringList & | commands, |
const CommandInterpreterRunOptions & | options, | ||
CommandReturnObject & | result | ||
) |
void lldb_private::CommandInterpreter::HandleCommands | ( | const StringList & | commands, |
const ExecutionContext & | context, | ||
const CommandInterpreterRunOptions & | options, | ||
CommandReturnObject & | result | ||
) |
Execute a list of commands in sequence.
[in] | commands | The list of commands to execute. |
[in,out] | context | The execution context in which to run the commands. |
[in] | options | This object holds the options used to control when to stop, whether to execute commands, etc. |
[out] | result | This is marked as succeeding with no output if all commands execute safely, and failed with some explanation if we aborted executing the commands at some point. |
Referenced by lldb_private::BreakpointOptions::BreakpointOptionsCallbackFunction(), and lldb_private::Target::StopHookCommandLine::HandleStop().
void lldb_private::CommandInterpreter::HandleCommandsFromFile | ( | FileSpec & | file, |
const CommandInterpreterRunOptions & | options, | ||
CommandReturnObject & | result | ||
) |
void lldb_private::CommandInterpreter::HandleCommandsFromFile | ( | FileSpec & | file, |
const ExecutionContext & | context, | ||
const CommandInterpreterRunOptions & | options, | ||
CommandReturnObject & | result | ||
) |
Execute a list of commands from a file.
[in] | file | The file from which to read in commands. |
[in,out] | context | The execution context in which to run the commands. |
[in] | options | This object holds the options used to control when to stop, whether to execute commands, etc. |
[out] | result | This is marked as succeeding with no output if all commands execute safely, and failed with some explanation if we aborted executing the commands at some point. |
Referenced by lldb::SBCommandInterpreter::HandleCommandsFromFile().
void lldb_private::CommandInterpreter::HandleCompletion | ( | CompletionRequest & | request | ) |
void lldb_private::CommandInterpreter::HandleCompletionMatches | ( | CompletionRequest & | request | ) |
Referenced by lldb_private::CommandObjectHelp::HandleCompletion().
bool lldb_private::CommandInterpreter::HasAliases | ( | ) | const |
Referenced by lldb::SBCommandInterpreter::HasAliases().
bool lldb_private::CommandInterpreter::HasAliasOptions | ( | ) | const |
Referenced by lldb::SBCommandInterpreter::HasAliasOptions().
bool lldb_private::CommandInterpreter::HasCommands | ( | ) | const |
Referenced by lldb::SBCommandInterpreter::HasCommands().
bool lldb_private::CommandInterpreter::HasUserCommands | ( | ) | const |
bool lldb_private::CommandInterpreter::HasUserMultiwordCommands | ( | ) | const |
void CommandInterpreter::Initialize | ( | ) |
Definition at line 271 of file CommandInterpreter.cpp.
References AddAlias(), GetCommandSPExact(), lldb_private::StreamString::GetString(), lldb_private::Debugger::GetUseColor(), LLDB_SCOPED_TIMER, LoadCommandDictionary(), m_debugger, lldb_private::Stream::Printf(), lldb_private::CommandAlias::SetHelp(), lldb_private::CommandAlias::SetHelpLong(), and lldb_private::CommandObject::SetSyntax().
|
private |
|
inlineoverrideprotectedvirtual |
Reimplemented from lldb_private::IOHandlerDelegate.
Definition at line 646 of file CommandInterpreter.h.
|
overrideprotectedvirtual |
Called when a line or lines have been retrieved.
This function can handle the current line and possibly call IOHandler::SetIsDone(true) when the IO handler is done like when "quit" is entered as a command, of when an empty line is received. It is up to the delegate to determine when a line should cause a IOHandler to exit.
Implements lldb_private::IOHandlerDelegate.
|
overridevirtual |
Reimplemented from lldb_private::IOHandlerDelegate.
bool lldb_private::CommandInterpreter::IsActive | ( | ) |
Referenced by lldb::SBCommandInterpreter::IsActive().
bool lldb_private::CommandInterpreter::IsInteractive | ( | ) |
Referenced by lldb::SBCommandInterpreter::IsInteractive().
void CommandInterpreter::LoadCommandDictionary | ( | ) |
Definition at line 529 of file CommandInterpreter.cpp.
References lldb_private::CommandCompletions::eSourceFileCompletion, lldb_private::CommandCompletions::eSymbolCompletion, LLDB_SCOPED_TIMER, m_command_dict, REGISTER_COMMAND_OBJECT, and string().
Referenced by Initialize().
void lldb_private::CommandInterpreter::OutputFormattedHelpText | ( | Stream & | stream, |
llvm::StringRef | command_word, | ||
llvm::StringRef | separator, | ||
llvm::StringRef | help_text, | ||
size_t | max_word_len | ||
) |
void lldb_private::CommandInterpreter::OutputFormattedHelpText | ( | Stream & | strm, |
llvm::StringRef | prefix, | ||
llvm::StringRef | help_text | ||
) |
Referenced by lldb_private::CommandObjectApropos::DoExecute(), lldb_private::Property::DumpDescription(), lldb_private::CommandObject::FormatLongHelpText(), lldb_private::CommandObjectMultiword::GenerateHelpText(), lldb_private::CommandObject::GenerateHelpText(), and lldb_private::CommandObject::GetArgumentHelp().
void lldb_private::CommandInterpreter::OutputHelpText | ( | Stream & | stream, |
llvm::StringRef | command_word, | ||
llvm::StringRef | separator, | ||
llvm::StringRef | help_text, | ||
uint32_t | max_word_len | ||
) |
Referenced by lldb_private::CommandObject::GetArgumentHelp().
|
private |
|
private |
|
private |
|
inline |
Definition at line 517 of file CommandInterpreter.h.
References eUnwarnedOmission, eWarnedOmission, m_max_depth_warning, m_truncation_warning, and lldb_private::Stream::Printf().
const char * CommandInterpreter::ProcessEmbeddedScriptCommands | ( | const char * | arg | ) |
Definition at line 513 of file CommandInterpreter.cpp.
Referenced by lldb_private::CommandObjectParsed::Execute().
bool lldb_private::CommandInterpreter::RemoveAlias | ( | llvm::StringRef | alias_name | ) |
|
inline |
Definition at line 341 of file CommandInterpreter.h.
References m_user_dict.
|
inline |
Definition at line 337 of file CommandInterpreter.h.
References m_user_mw_dict.
bool lldb_private::CommandInterpreter::RemoveCommand | ( | llvm::StringRef | cmd | ) |
bool lldb_private::CommandInterpreter::RemoveUser | ( | llvm::StringRef | alias_name | ) |
bool lldb_private::CommandInterpreter::RemoveUserMultiword | ( | llvm::StringRef | multiword_name | ) |
void CommandInterpreter::ResolveCommand | ( | const char * | command_line, |
CommandReturnObject & | result | ||
) |
Definition at line 238 of file CommandInterpreter.cpp.
References lldb_private::CommandReturnObject::AppendMessageWithFormat(), lldb::eReturnStatusSuccessFinishResult, ResolveCommandImpl(), lldb_private::CommandReturnObject::SetStatus(), and string().
Referenced by lldb::SBCommandInterpreter::ResolveCommand().
|
private |
Referenced by ResolveCommand().
|
private |
CommandInterpreterRunResult lldb_private::CommandInterpreter::RunCommandInterpreter | ( | CommandInterpreterRunOptions & | options | ) |
Referenced by lldb::SBDebugger::RunCommandInterpreter().
bool lldb_private::CommandInterpreter::SaveTranscript | ( | CommandReturnObject & | result, |
std::optional< std::string > | output_file = std::nullopt |
||
) |
Save the current debugger session transcript to a file on disk.
output_file | The file path to which the session transcript will be written. Since the argument is optional, an arbitrary temporary file will be create when no argument is passed. |
result | This is used to pass function output and error messages. |
Referenced by lldb_private::Debugger::Destroy().
|
inline |
Definition at line 501 of file CommandInterpreter.h.
References m_batch_command_mode.
void CommandInterpreter::SetEchoCommands | ( | bool | enable | ) |
Definition at line 202 of file CommandInterpreter.cpp.
References lldb_private::Properties::m_collection_sp.
void CommandInterpreter::SetEchoCommentCommands | ( | bool | enable | ) |
Definition at line 213 of file CommandInterpreter.cpp.
References lldb_private::Properties::m_collection_sp.
void CommandInterpreter::SetOpenTranscriptInEditor | ( | bool | enable | ) |
Definition at line 181 of file CommandInterpreter.cpp.
References lldb_private::Properties::m_collection_sp.
void CommandInterpreter::SetPromptOnQuit | ( | bool | enable | ) |
Definition at line 159 of file CommandInterpreter.cpp.
References lldb_private::Properties::m_collection_sp.
Referenced by lldb_private::REPL::IOHandlerInputComplete(), and lldb::SBCommandInterpreter::SetPromptOnQuit().
bool CommandInterpreter::SetQuitExitCode | ( | int | exit_code | ) |
Sets the exit code for the quit command.
[in] | exit_code | The exit code that the driver should return on exit. |
Definition at line 224 of file CommandInterpreter.cpp.
References m_allow_exit_code, and m_quit_exit_code.
Referenced by lldb_private::CommandObjectQuit::DoExecute().
|
inline |
Definition at line 512 of file CommandInterpreter.h.
References eNoOmission, eUnwarnedOmission, and m_max_depth_warning.
void CommandInterpreter::SetSaveSessionDirectory | ( | llvm::StringRef | path | ) |
Definition at line 191 of file CommandInterpreter.cpp.
References lldb_private::Properties::m_collection_sp.
void CommandInterpreter::SetSaveSessionOnQuit | ( | bool | enable | ) |
Definition at line 170 of file CommandInterpreter.cpp.
References lldb_private::Properties::m_collection_sp.
|
protected |
Referenced by CommandInterpreter().
|
inline |
Definition at line 486 of file CommandInterpreter.h.
References m_skip_app_init_files.
Referenced by lldb::SBDebugger::Create().
|
inline |
Definition at line 482 of file CommandInterpreter.h.
References m_skip_lldbinit_files.
Referenced by lldb::SBDebugger::Create().
|
private |
void lldb_private::CommandInterpreter::SourceInitFileCwd | ( | CommandReturnObject & | result | ) |
void lldb_private::CommandInterpreter::SourceInitFileGlobal | ( | CommandReturnObject & | result | ) |
void lldb_private::CommandInterpreter::SourceInitFileHome | ( | CommandReturnObject & | result, |
bool | is_repl | ||
) |
Referenced by lldb::SBCommandInterpreter::SourceInitFileInHomeDirectory().
|
private |
void lldb_private::CommandInterpreter::UpdatePrompt | ( | llvm::StringRef | prompt | ) |
bool lldb_private::CommandInterpreter::UserCommandExists | ( | llvm::StringRef | cmd | ) | const |
Determine whether a root-level user command with this name exists.
bool lldb_private::CommandInterpreter::UserMultiwordCommandExists | ( | llvm::StringRef | cmd | ) | const |
Determine whether a root-level user multiword command with this name exists.
CommandObjectMultiword* lldb_private::CommandInterpreter::VerifyUserMultiwordCmdPath | ( | Args & | path, |
bool | leaf_is_command, | ||
Status & | result | ||
) |
Look up the command pointed to by path encoded in the arguments of the incoming command object.
If all the path components exist and are all actual commands - not aliases, and the leaf command is a multiword command, return the command. Otherwise return nullptr, and put a useful diagnostic in the Status object.
[in] | path | An Args object holding the path in its arguments |
[in] | leaf_is_command | If true, return the container of the leaf name rather than looking up the whole path as a leaf command. The leaf needn't exist in this case. |
[in,out] | result | If the path is not found, this error shows where we got off track. |
Referenced by lldb_private::CommandCompletions::CompleteModifiableCmdPathArgs().
bool lldb_private::CommandInterpreter::WasInterrupted | ( | ) | const |
Referenced by lldb::SBCommandInterpreter::WasInterrupted().
|
friend |
Definition at line 640 of file CommandInterpreter.h.
|
static |
Definition at line 249 of file CommandInterpreter.h.
Referenced by lldb_private::CommandAlias::GetAliasExpansion(), and lldb_private::CommandAlias::IsDashDashCommand().
|
static |
Definition at line 248 of file CommandInterpreter.h.
Referenced by lldb_private::CommandAlias::GetAliasExpansion().
|
static |
Definition at line 247 of file CommandInterpreter.h.
Referenced by lldb_private::CommandAlias::GetAliasExpansion().
|
private |
Definition at line 718 of file CommandInterpreter.h.
Referenced by GetAliases().
|
private |
Definition at line 748 of file CommandInterpreter.h.
Referenced by AllowExitCodeOnQuit(), and SetQuitExitCode().
|
private |
Definition at line 727 of file CommandInterpreter.h.
Referenced by GetBatchCommandMode(), and SetBatchCommandMode().
|
private |
Definition at line 714 of file CommandInterpreter.h.
Referenced by GetCommands(), and LoadCommandDictionary().
|
private |
Definition at line 722 of file CommandInterpreter.h.
Referenced by GetCommandHistory().
|
private |
Definition at line 725 of file CommandInterpreter.h.
Referenced by Clear().
|
private |
Definition at line 737 of file CommandInterpreter.h.
|
private |
A stack of directory paths.
When not empty, the last one is the directory of the file that's currently sourced.
Definition at line 740 of file CommandInterpreter.h.
|
private |
Definition at line 741 of file CommandInterpreter.h.
|
private |
Definition at line 697 of file CommandInterpreter.h.
|
private |
Definition at line 726 of file CommandInterpreter.h.
|
private |
Definition at line 706 of file CommandInterpreter.h.
Referenced by GetDebugger(), and Initialize().
|
private |
Definition at line 700 of file CommandInterpreter.h.
|
private |
Whether we reached the maximum child nesting depth and whether the user has been told.
Definition at line 733 of file CommandInterpreter.h.
Referenced by PrintWarningsIfNecessary(), and SetReachedMaximumDepth().
|
private |
Definition at line 710 of file CommandInterpreter.h.
|
private |
Definition at line 746 of file CommandInterpreter.h.
Referenced by AllowExitCodeOnQuit(), GetQuitExitCode(), and SetQuitExitCode().
|
private |
Definition at line 723 of file CommandInterpreter.h.
|
private |
Definition at line 742 of file CommandInterpreter.h.
|
private |
Definition at line 713 of file CommandInterpreter.h.
Referenced by SkipAppInitFiles().
|
private |
Definition at line 712 of file CommandInterpreter.h.
Referenced by SkipLLDBInitFiles().
|
private |
Definition at line 711 of file CommandInterpreter.h.
|
private |
Definition at line 750 of file CommandInterpreter.h.
|
private |
Whether we truncated a value's list of children and whether the user has been told.
Definition at line 730 of file CommandInterpreter.h.
Referenced by ChildrenTruncated(), and PrintWarningsIfNecessary().
|
private |
Definition at line 719 of file CommandInterpreter.h.
Referenced by GetUserCommands(), and RemoveAllUser().
|
private |
Definition at line 721 of file CommandInterpreter.h.
Referenced by GetUserMultiwordCommands(), and RemoveAllUserMultiword().