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 } |
Public Types inherited from lldb_private::IOHandlerDelegate | |
enum class | Completion { None , LLDBCommand , Expression } |
Public Member Functions | |
CommandInterpreter (Debugger &debugger, bool synchronous_execution) | |
~CommandInterpreter () override=default | |
llvm::StringRef | 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. | |
void | SourceInitFileCwd (CommandReturnObject &result) |
void | SourceInitFileHome (CommandReturnObject &result, bool is_repl) |
We will first see if there is an application specific ".lldbinit" file whose name is "~/.lldbinit" followed by a "-" and the name of the program. | |
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 |
CommandObject * | GetAliasCommandObject (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. | |
bool | AliasExists (llvm::StringRef cmd) const |
Determine whether an alias command with this name exists. | |
bool | UserCommandExists (llvm::StringRef cmd) const |
Determine whether a root-level user command with this name exists. | |
bool | UserMultiwordCommandExists (llvm::StringRef cmd) const |
Determine whether a root-level user multiword command with this name exists. | |
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. | |
CommandAlias * | AddAlias (llvm::StringRef alias_name, lldb::CommandObjectSP &command_obj_sp, llvm::StringRef args_string=llvm::StringRef()) |
bool | RemoveCommand (llvm::StringRef cmd, bool force=false) |
Remove a command if it is removable (python or regex command). | |
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 force_repeat_command=false) |
bool | InterruptCommand () |
void | HandleCommands (const StringList &commands, const ExecutionContext &context, const CommandInterpreterRunOptions &options, CommandReturnObject &result) |
Execute a list of commands in sequence. | |
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. | |
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. | |
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. | |
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 | GetSaveTranscript () const |
void | SetSaveTranscript (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'. | |
bool | SetQuitExitCode (int exit_code) |
Sets the exit code for the quit command. | |
int | GetQuitExitCode (bool &exited) const |
Returns the exit code that the user has specified when running the 'quit' command. | |
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. | |
FileSpec | GetCurrentSourceDir () |
bool | IsInteractive () |
bool | IOHandlerInterrupt (IOHandler &io_handler) override |
Status | PreprocessCommand (std::string &command) |
Status | PreprocessToken (std::string &token) |
void | IncreaseCommandUsage (const CommandObject &cmd_obj) |
llvm::json::Value | GetStatistics () |
const StructuredData::Array & | GetTranscript () const |
Public Member Functions inherited from lldb_private::Broadcaster | |
Broadcaster (lldb::BroadcasterManagerSP manager_sp, std::string name) | |
Construct with a broadcaster with a name. | |
virtual | ~Broadcaster () |
Destructor. | |
void | CheckInWithManager () |
void | BroadcastEvent (lldb::EventSP &event_sp) |
Broadcast an event which has no associated data. | |
void | BroadcastEventIfUnique (lldb::EventSP &event_sp) |
void | BroadcastEvent (uint32_t event_type, const lldb::EventDataSP &event_data_sp) |
void | BroadcastEvent (uint32_t event_type) |
void | BroadcastEventIfUnique (uint32_t event_type) |
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. | |
const std::string & | GetBroadcasterName () |
Get this broadcaster's name. | |
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. | |
void | SetEventName (uint32_t event_mask, const char *name) |
Set the name for an event bit. | |
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. | |
bool | HijackBroadcaster (const lldb::ListenerSP &listener_sp, uint32_t event_mask=UINT32_MAX) |
Provides a simple mechanism to temporarily redirect events from broadcaster. | |
bool | IsHijackedForEvent (uint32_t event_mask) |
void | RestoreBroadcaster () |
Restore the state of the Broadcaster from a previous hijack attempt. | |
virtual llvm::StringRef | GetBroadcasterClass () const |
This needs to be filled in if you are going to register the broadcaster with the broadcaster manager and do broadcaster class matching. | |
lldb::BroadcasterManagerSP | GetManager () |
void | SetPrimaryListener (lldb::ListenerSP listener_sp) |
lldb::ListenerSP | GetPrimaryListener () |
Public Member Functions inherited from lldb_private::Properties | |
Properties () | |
Properties (const lldb::OptionValuePropertiesSP &collection_sp) | |
virtual | ~Properties () |
virtual lldb::OptionValuePropertiesSP | GetValueProperties () const |
virtual lldb::OptionValueSP | GetPropertyValue (const ExecutionContext *exe_ctx, llvm::StringRef property_path, 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 |
template<typename T > | |
T | GetPropertyAtIndexAs (uint32_t idx, T default_value, const ExecutionContext *exe_ctx=nullptr) const |
template<typename T , typename U = typename std::remove_pointer<T>::type, std::enable_if_t< std::is_pointer_v< T >, bool > = true> | |
const U * | GetPropertyAtIndexAs (uint32_t idx, const ExecutionContext *exe_ctx=nullptr) const |
template<typename T > | |
bool | SetPropertyAtIndex (uint32_t idx, T t, const ExecutionContext *exe_ctx=nullptr) const |
Public Member Functions inherited from lldb_private::IOHandlerDelegate | |
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. | |
virtual void | IOHandlerInputComplete (IOHandler &io_handler, std::string &data)=0 |
Called when a line or lines have been retrieved. | |
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. | |
virtual llvm::StringRef | IOHandlerGetControlSequence (char ch) |
virtual const char * | IOHandlerGetCommandPrefix () |
virtual const char * | IOHandlerGetHelpPrologue () |
virtual bool | IOHandlerInterrupt (IOHandler &io_handler) |
Static Public Member Functions | |
static llvm::StringRef | GetStaticBroadcasterClass () |
Static Public Member Functions inherited from lldb_private::Properties | |
static llvm::StringRef | 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 | |
bool | WasInterrupted () const |
void | IOHandlerInputComplete (IOHandler &io_handler, std::string &line) override |
Called when a line or lines have been retrieved. | |
llvm::StringRef | 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 |
Protected Member Functions inherited from lldb_private::Broadcaster | |
BroadcasterImplSP | GetBroadcasterImpl () |
const char * | GetHijackingListenerName () |
Private Types | |
enum class | CommandHandlingState { eIdle , eInProgress , eInterrupted } |
typedef llvm::StringMap< uint64_t > | CommandUsageMap |
Command usage statistics. | |
Private Member Functions | |
void | OverrideExecutionContext (const ExecutionContext &override_context) |
void | RestoreExecutionContext () |
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 () |
Friends | |
class | Debugger |
Additional Inherited Members | |
Protected Types inherited from lldb_private::Broadcaster | |
typedef std::shared_ptr< BroadcasterImpl > | BroadcasterImplSP |
typedef std::weak_ptr< BroadcasterImpl > | BroadcasterImplWP |
Protected Attributes inherited from lldb_private::Properties | |
lldb::OptionValuePropertiesSP | m_collection_sp |
Protected Attributes inherited from lldb_private::IOHandlerDelegate | |
Completion | m_completion |
Definition at line 229 of file CommandInterpreter.h.
|
private |
Command usage statistics.
Definition at line 786 of file CommandInterpreter.h.
anonymous enum |
Enumerator | |
---|---|
eBroadcastBitThreadShouldExit | |
eBroadcastBitResetPrompt | |
eBroadcastBitQuitCommandReceived | |
eBroadcastBitAsynchronousOutputData | |
eBroadcastBitAsynchronousErrorData |
Definition at line 233 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 242 of file CommandInterpreter.h.
|
strongprivate |
Enumerator | |
---|---|
eIdle | |
eInProgress | |
eInterrupted |
Definition at line 727 of file CommandInterpreter.h.
Enumerator | |
---|---|
eCommandTypesBuiltin | |
eCommandTypesUserDef | |
eCommandTypesUserMW | |
eCommandTypesAliases | |
eCommandTypesHidden | |
eCommandTypesAllThem |
Definition at line 248 of file CommandInterpreter.h.
CommandInterpreter::CommandInterpreter | ( | Debugger & | debugger, |
bool | synchronous_execution | ||
) |
Definition at line 130 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 * CommandInterpreter::AddAlias | ( | llvm::StringRef | alias_name, |
lldb::CommandObjectSP & | command_obj_sp, | ||
llvm::StringRef | args_string = llvm::StringRef() |
||
) |
Definition at line 1382 of file CommandInterpreter.cpp.
References lldbassert, and m_alias_dict.
Referenced by Initialize().
bool CommandInterpreter::AddCommand | ( | llvm::StringRef | name, |
const lldb::CommandObjectSP & | cmd_sp, | ||
bool | can_replace | ||
) |
Definition at line 1140 of file CommandInterpreter.cpp.
References lldbassert, and m_command_dict.
Status CommandInterpreter::AddUserCommand | ( | llvm::StringRef | name, |
const lldb::CommandObjectSP & | cmd_sp, | ||
bool | can_replace | ||
) |
Definition at line 1164 of file CommandInterpreter.cpp.
References CommandExists(), lldbassert, m_user_dict, m_user_mw_dict, lldb_private::Status::SetErrorString(), lldb_private::Status::SetErrorStringWithFormatv(), and UserCommandExists().
Referenced by lldb::SBCommandInterpreter::AddCommand(), lldb::SBCommandInterpreter::AddMultiwordCommand(), CommandObjectCommandsScriptAdd::DoExecute(), CommandObjectCommandsContainerAdd::DoExecute(), and CommandObjectCommandsScriptAdd::IOHandlerInputComplete().
bool CommandInterpreter::AliasExists | ( | llvm::StringRef | cmd | ) | const |
Determine whether an alias command with this name exists.
Definition at line 1369 of file CommandInterpreter.cpp.
References m_alias_dict.
Referenced by lldb::SBCommandInterpreter::AliasExists(), and CommandObjectCommandsUnalias::DoExecute().
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 232 of file CommandInterpreter.cpp.
References m_allow_exit_code, and m_quit_exit_code.
Referenced by lldb::SBCommandInterpreter::AllowExitCodeOnQuit().
void CommandInterpreter::BuildAliasCommandArgs | ( | CommandObject * | alias_cmd_obj, |
const char * | alias_name, | ||
Args & | cmd_args, | ||
std::string & | raw_input_string, | ||
CommandReturnObject & | result | ||
) |
Definition at line 2217 of file CommandInterpreter.cpp.
References lldb_private::Args::AppendArgument(), lldb_private::CommandReturnObject::AppendErrorWithFormat(), lldb_private::Args::Clear(), lldb_private::Args::entries(), lldb_private::OptionParser::eOptionalArgument, lldb::eReturnStatusSuccessFinishNoResult, g_argument, g_no_argument, GetAlias(), lldb_private::Args::GetArgumentAtIndex(), lldb_private::Args::GetArgumentCount(), lldb_private::CommandObject::GetCommandName(), lldb_private::Args::GetConstArgumentVector(), GetOptionArgumentPosition(), lldb_private::CommandAlias::GetOptionArguments(), lldb_private::Args::SetArguments(), lldb_private::CommandReturnObject::SetStatus(), lldb_private::Args::Shift(), lldb_private::Args::Unshift(), and lldb_private::CommandObject::WantsRawCommandString().
CommandObject * CommandInterpreter::BuildAliasResult | ( | llvm::StringRef | alias_name, |
std::string & | raw_input_string, | ||
std::string & | alias_result, | ||
CommandReturnObject & | result | ||
) |
Definition at line 1657 of file CommandInterpreter.cpp.
References lldb_private::CommandReturnObject::AppendError(), lldb_private::CommandReturnObject::AppendErrorWithFormat(), lldb_private::Args::ArgEntry::c_str(), lldb_private::OptionParser::eNoArgument, lldb_private::OptionParser::eOptionalArgument, g_argument, lldb_private::Args::GetArgumentAtIndex(), lldb_private::Args::GetArgumentCount(), lldb_private::CommandObject::GetCommandName(), GetCommandObject(), GetOptionArgumentPosition(), lldb_private::Args::ArgEntry::GetQuoteChar(), lldb_private::StreamString::GetString(), lldb_private::CommandObject::IsAlias(), lldb_private::Stream::Printf(), lldb_private::Args::ArgEntry::ref(), and lldb_private::Args::Unshift().
Referenced by ResolveCommandImpl().
|
inline |
Definition at line 527 of file CommandInterpreter.h.
References eNoOmission, eUnwarnedOmission, and m_truncation_warning.
void CommandInterpreter::Clear | ( | ) |
Definition at line 537 of file CommandInterpreter.cpp.
References m_command_io_handler_sp.
bool CommandInterpreter::CommandExists | ( | llvm::StringRef | cmd | ) | const |
Determine whether a root level, built-in command with this name exists.
Definition at line 1335 of file CommandInterpreter.cpp.
References m_command_dict.
Referenced by AddUserCommand(), lldb::SBCommandInterpreter::CommandExists(), CommandObjectCommandsUnalias::DoExecute(), and CommandObjectCommandsDelete::DoExecute().
bool CommandInterpreter::Confirm | ( | llvm::StringRef | message, |
bool | default_answer | ||
) |
Definition at line 2182 of file CommandInterpreter.cpp.
References lldb_private::Debugger::GetAutoConfirm(), lldb_private::IOHandlerConfirm::GetResponse(), m_debugger, and lldb_private::Debugger::RunIOHandlerSync().
Referenced by lldb_private::CommandObjectQuit::DoExecute(), CommandObjectBreakpointDelete::DoExecute(), CommandObjectFrameRecognizerDelete::DoExecute(), CommandObjectTargetStopHookDelete::DoExecute(), CommandObjectProcessHandle::DoExecute(), and CommandObjectProcessLaunchOrAttach::StopProcessIfNecessary().
|
protected |
Definition at line 2521 of file CommandInterpreter.cpp.
References lldb::eStateStopped, lldb::eStopReasonException, lldb::eStopReasonInstrumentation, lldb::eStopReasonInterrupt, lldb::eStopReasonProcessorTrace, lldb::eStopReasonSignal, and GetExecutionContext().
Referenced by HandleCommands(), and IOHandlerInputComplete().
|
private |
Definition at line 3108 of file CommandInterpreter.cpp.
References eHandleCommandFlagEchoCommand, eHandleCommandFlagEchoCommentCommand, m_comment_char, and lldb_private::Flags::Test().
Referenced by IOHandlerInputComplete().
void 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 | ||
) |
Definition at line 3001 of file CommandInterpreter.cpp.
References FindCommandsForApropos(), m_alias_dict, m_command_dict, m_user_dict, and m_user_mw_dict.
Referenced by lldb_private::CommandObjectApropos::DoExecute(), and FindCommandsForApropos().
|
private |
|
private |
Definition at line 3059 of file CommandInterpreter.cpp.
References eIdle, lldbassert, m_command_state, and m_iohandler_nesting_level.
Referenced by IOHandlerInputComplete().
const CommandAlias * CommandInterpreter::GetAlias | ( | llvm::StringRef | alias_name | ) | const |
Definition at line 2195 of file CommandInterpreter.cpp.
References m_alias_dict.
Referenced by BuildAliasCommandArgs(), and lldb_private::CommandObjectHelp::DoExecute().
CommandObject * CommandInterpreter::GetAliasCommandObject | ( | llvm::StringRef | cmd, |
StringList * | matches = nullptr , |
||
StringList * | descriptions = nullptr |
||
) | const |
Definition at line 1302 of file CommandInterpreter.cpp.
References lldb_private::AddNamesMatchingPartialString(), lldb_private::StringList::AppendString(), GetAliases(), lldb_private::CommandObject::GetCommandName(), and lldb_private::CommandObject::GetHelp().
Referenced by ResolveCommandImpl().
|
inline |
Definition at line 614 of file CommandInterpreter.h.
References m_alias_dict.
Referenced by GetAliasCommandObject(), and CommandObjectCommandsUnalias::HandleArgumentCompletion().
bool CommandInterpreter::GetAliasFullName | ( | llvm::StringRef | cmd, |
std::string & | full_name | ||
) | const |
Definition at line 1339 of file CommandInterpreter.cpp.
References lldb_private::AddNamesMatchingPartialString(), GetCommandSP(), lldb_private::StringList::GetSize(), lldb_private::StringList::GetStringAtIndex(), and m_alias_dict.
Referenced by lldb_private::CommandObjectHelp::DoExecute(), and ResolveCommandImpl().
void lldb_private::CommandInterpreter::GetAliasHelp | ( | const char * | alias_name, |
StreamString & | help_string | ||
) |
std::optional< std::string > CommandInterpreter::GetAutoSuggestionForCommand | ( | llvm::StringRef | line | ) |
Returns the auto-suggestion string that should be added to the given command line.
Definition at line 2161 of file CommandInterpreter.cpp.
References lldb_private::CommandHistory::GetSize(), lldb_private::CommandHistory::GetStringAtIndex(), and m_command_history.
Referenced by lldb_private::IOHandlerDelegate::IOHandlerSuggestion().
|
inline |
Definition at line 519 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 273 of file CommandInterpreter.h.
References GetStaticBroadcasterClass().
|
inline |
Definition at line 557 of file CommandInterpreter.h.
References m_command_history.
Referenced by CommandObjectSessionHistory::DoExecute().
int CommandInterpreter::GetCommandNamesMatchingPartialString | ( | const char * | cmd_cstr, |
bool | include_aliases, | ||
StringList & | matches, | ||
StringList & | descriptions | ||
) |
Definition at line 942 of file CommandInterpreter.cpp.
References lldb_private::AddNamesMatchingPartialString(), lldb_private::StringList::GetSize(), m_alias_dict, and m_command_dict.
Referenced by HandleCompletionMatches().
CommandObject * CommandInterpreter::GetCommandObject | ( | llvm::StringRef | cmd, |
StringList * | matches = nullptr , |
||
StringList * | descriptions = nullptr |
||
) | const |
Definition at line 1256 of file CommandInterpreter.cpp.
References GetCommandSP().
Referenced by BuildAliasResult(), CommandObjectCommandsUnalias::DoExecute(), lldb_private::CommandObjectHelp::DoExecute(), GetCommandObjectForCommand(), lldb_private::CommandObjectHelp::HandleCompletion(), HandleCompletionMatches(), lldb_private::StructuredDataPlugin::InitializeBasePluginForDebugger(), and ResolveCommandImpl().
CommandObject * CommandInterpreter::GetCommandObjectForCommand | ( | llvm::StringRef & | command_line | ) |
Definition at line 1515 of file CommandInterpreter.cpp.
References GetCommandObject(), lldb_private::CommandObject::GetSubcommandObject(), lldb_private::CommandObject::IsMultiwordObject(), and k_white_space.
Referenced by lldb_private::StructuredDataDarwinLog::DebuggerInitialize(), lldb_private::REPL::RunLoop(), and lldb::SBCommandInterpreter::SetCommandOverrideCallback().
const char * CommandInterpreter::GetCommandPrefix | ( | ) |
Definition at line 2502 of file CommandInterpreter.cpp.
References GetDebugger(), and lldb_private::Debugger::GetIOHandlerCommandPrefix().
Referenced by lldb_private::CommandObjectHelp::DoExecute(), and GetHelp().
|
inline |
Definition at line 610 of file CommandInterpreter.h.
References m_command_dict.
Referenced by CommandObjectCommandsDelete::HandleArgumentCompletion().
|
protected |
Definition at line 1014 of file CommandInterpreter.cpp.
References lldb_private::AddNamesMatchingPartialString(), lldb_private::StringList::AppendString(), lldb_private::StringList::GetStringAtIndex(), HasAliases(), HasCommands(), HasUserCommands(), HasUserMultiwordCommands(), m_alias_dict, m_command_dict, m_user_dict, and m_user_mw_dict.
Referenced by GetAliasFullName(), GetCommandObject(), and GetCommandSPExact().
CommandObjectSP CommandInterpreter::GetCommandSPExact | ( | llvm::StringRef | cmd, |
bool | include_aliases = false |
||
) | const |
Definition at line 1214 of file CommandInterpreter.cpp.
References lldb_private::Args::GetArgumentAtIndex(), lldb_private::Args::GetArgumentCount(), and GetCommandSP().
Referenced by CommandObjectCommandsScriptDelete::DoExecute(), CommandObjectCommandsContainerDelete::DoExecute(), Initialize(), and VerifyUserMultiwordCmdPath().
FileSpec CommandInterpreter::GetCurrentSourceDir | ( | ) |
Definition at line 3319 of file CommandInterpreter.cpp.
References m_command_source_dirs.
Referenced by CommandObjectCommandsSource::DoExecute(), and CommandObjectCommandsScriptImport::DoExecute().
|
inline |
Definition at line 466 of file CommandInterpreter.h.
References m_debugger.
Referenced by lldb_private::CommandCompletions::BreakpointNames(), lldb_private::CommandCompletions::Breakpoints(), lldb_private::OptionGroupPlatform::CreatePlatformWithOptions(), lldb_private::CommandPluginInterfaceImplementation::DoExecute(), lldb_private::CommandObjectDisassemble::DoExecute(), sddarwinlog_private::EnableCommand::DoExecute(), sddarwinlog_private::StatusCommand::DoExecute(), CommandObjectScriptingRun::DoExecute(), lldb_private::CommandCompletions::FrameIndexes(), GetCommandPrefix(), lldb::SBCommandInterpreter::GetDebugger(), lldb_private::CommandObject::GetDebugger(), lldb_private::CommandObject::GetDefaultThread(), lldb_private::CommandObject::GetDummyTarget(), GetHelp(), lldb::SBCommandInterpreter::GetIOHandlerControlSequence(), GetLLDBCommandsFromIOHandler(), lldb::SBCommandInterpreter::GetProcess(), GetPythonCommandsFromIOHandler(), lldb_private::CommandObject::GetTarget(), HandleCommand(), HandleCommandsFromFile(), lldb_private::CommandObject::HandleCompletion(), lldb_private::Options::HandleOptionArgumentCompletion(), LookupSymbolInModule(), lldb_private::CommandCompletions::Modules(), CommandObjectScriptingObjectParsed::CommandOptions::OptionParsingStarting(), PrintCommandOutput(), lldb_private::CommandCompletions::RemoteDiskDirectories(), lldb_private::CommandCompletions::RemoteDiskFiles(), sddarwinlog_private::RunEnableCommand(), CommandObjectScriptingObjectParsed::CommandOptions::SetOptionValue(), lldb_private::CommandCompletions::SettingsNames(), lldb_private::CommandCompletions::SourceFiles(), SourceInitFileHome(), lldb::SBCommandInterpreter::SourceInitFileInCurrentWorkingDirectory(), lldb::SBCommandInterpreter::SourceInitFileInGlobalDirectory(), lldb::SBCommandInterpreter::SourceInitFileInHomeDirectory(), lldb_private::CommandCompletions::Symbols(), and lldb::SBCommandInterpreter::WasInterrupted().
bool CommandInterpreter::GetEchoCommands | ( | ) | const |
Definition at line 210 of file CommandInterpreter.cpp.
Referenced by CommandObjectCommandsSource::DoExecute().
bool CommandInterpreter::GetEchoCommentCommands | ( | ) | const |
Definition at line 221 of file CommandInterpreter.cpp.
Referenced by CommandObjectCommandsSource::DoExecute().
ExecutionContext CommandInterpreter::GetExecutionContext | ( | ) | const |
Definition at line 3027 of file CommandInterpreter.cpp.
References lldb_private::Debugger::GetSelectedExecutionContext(), m_debugger, and m_overriden_exe_contexts.
Referenced by lldb_private::OptionValueUUID::AutoComplete(), lldb_private::CommandObject::CheckRequirements(), DidProcessStopAbnormally(), CommandObjectProcessKDPPacketSend::DoExecute(), CommandObjectPlatformShell::DoExecute(), lldb_private::CommandObjectTraceProxy::DoGetProxyCommandObject(), DumpCompileUnitLineTable(), DumpModuleSections(), DumpModuleSymtab(), lldb_private::CommandCompletions::FrameIndexes(), GetPlatform(), GetProcessOutput(), CommandObjectProcessPlugin::GetProxyCommandObject(), lldb_private::CommandObject::GetTarget(), lldb_private::CommandObject::HandleCompletion(), IOHandlerInterrupt(), LookupAddressInModule(), LookupFileAndLineInModule(), LookupFunctionInModule(), LookupSymbolInModule(), lldb_private::CommandCompletions::ModuleUUIDs(), lldb_private::CommandObject::ParseOptions(), PreprocessToken(), lldb_private::CommandCompletions::Registers(), lldb_private::REPL::REPL(), lldb_private::CommandCompletions::StopHookIDs(), lldb_private::CommandCompletions::ThreadIDs(), lldb_private::CommandCompletions::ThreadIndexes(), lldb_private::CommandCompletions::VariablePath(), and lldb_private::CommandCompletions::WatchPointIDs().
bool CommandInterpreter::GetExpandRegexAliases | ( | ) | const |
Definition at line 150 of file CommandInterpreter.cpp.
Referenced by lldb_private::CommandObjectRegexCommand::DoExecute().
void CommandInterpreter::GetHelp | ( | CommandReturnObject & | result, |
uint32_t | types = eCommandTypesAllThem |
||
) |
Definition at line 1443 of file CommandInterpreter.cpp.
References lldb_private::CommandReturnObject::AppendMessage(), lldb_private::CommandReturnObject::AppendMessageWithFormat(), eCommandTypesAliases, eCommandTypesBuiltin, eCommandTypesHidden, eCommandTypesUserDef, eCommandTypesUserMW, lldb_private::FindLongestCommandWord(), GetCommandPrefix(), GetDebugger(), lldb_private::CommandReturnObject::GetOutputStream(), m_alias_dict, m_command_dict, m_user_dict, m_user_mw_dict, and OutputFormattedHelpText().
Referenced by CommandObjectCommandsScriptList::DoExecute(), and lldb_private::CommandObjectHelp::DoExecute().
lldb::IOHandlerSP CommandInterpreter::GetIOHandler | ( | bool | force_create = false , |
CommandInterpreterRunOptions * | options = nullptr |
||
) |
Definition at line 3368 of file CommandInterpreter.cpp.
References lldb_private::IOHandler::CommandInterpreter, eHandleCommandFlagAllowRepeats, eHandleCommandFlagEchoCommand, eHandleCommandFlagEchoCommentCommand, eHandleCommandFlagPrintErrors, eHandleCommandFlagPrintResult, eHandleCommandFlagStopOnContinue, eHandleCommandFlagStopOnCrash, eHandleCommandFlagStopOnError, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, lldb_private::Debugger::GetErrorStreamSP(), lldb_private::Debugger::GetInputFileSP(), lldb_private::Debugger::GetOutputStreamSP(), lldb_private::Debugger::GetPrompt(), lldb_private::Debugger::GetUseColor(), lldb_private::CommandInterpreterRunOptions::m_allow_repeats, m_command_io_handler_sp, m_debugger, lldb_private::CommandInterpreterRunOptions::m_echo_commands, lldb_private::CommandInterpreterRunOptions::m_echo_comment_commands, lldb_private::CommandInterpreterRunOptions::m_print_errors, lldb_private::CommandInterpreterRunOptions::m_print_results, lldb_private::CommandInterpreterRunOptions::m_stop_on_continue, lldb_private::CommandInterpreterRunOptions::m_stop_on_crash, and lldb_private::CommandInterpreterRunOptions::m_stop_on_error.
Referenced by lldb_private::REPL::IOHandlerInputComplete(), IsInteractive(), and RunCommandInterpreter().
void CommandInterpreter::GetLLDBCommandsFromIOHandler | ( | const char * | prompt, |
IOHandlerDelegate & | delegate, | ||
void * | baton = nullptr |
||
) |
Definition at line 3325 of file CommandInterpreter.cpp.
References lldb_private::IOHandler::CommandList, GetDebugger(), lldb_private::Debugger::GetUseColor(), and lldb_private::Debugger::RunIOHandlerAsync().
Referenced by CommandObjectBreakpointCommandAdd::CommandOptions::GetDefinitions().
bool CommandInterpreter::GetOpenTranscriptInEditor | ( | ) | const |
Definition at line 189 of file CommandInterpreter.cpp.
Referenced by SaveTranscript().
int CommandInterpreter::GetOptionArgumentPosition | ( | const char * | in_string | ) |
Picks the number out of a string of the form "%NNN", otherwise return 0.
Definition at line 2331 of file CommandInterpreter.cpp.
Referenced by BuildAliasCommandArgs(), and BuildAliasResult().
PlatformSP CommandInterpreter::GetPlatform | ( | bool | prefer_target_platform | ) |
Definition at line 2507 of file CommandInterpreter.cpp.
References GetExecutionContext(), lldb_private::Target::GetPlatform(), lldb_private::Debugger::GetPlatformList(), lldb_private::PlatformList::GetSelectedPlatform(), lldb_private::ExecutionContext::GetTargetPtr(), and m_debugger.
Referenced by CommandObjectProcessConnect::DoExecute(), lldb_private::CommandCompletions::ProcessIDs(), and lldb_private::CommandCompletions::ProcessNames().
|
protected |
Definition at line 3043 of file CommandInterpreter.cpp.
References lldb_private::Debugger::FlushProcessOutput(), GetExecutionContext(), and m_debugger.
Referenced by IOHandlerInputComplete().
bool CommandInterpreter::GetPromptOnQuit | ( | ) | const |
Definition at line 156 of file CommandInterpreter.cpp.
Referenced by lldb::SBCommandInterpreter::GetPromptOnQuit(), lldb_private::REPL::IOHandlerInputComplete(), and lldb_private::CommandObjectQuit::ShouldAskForConfirmation().
void CommandInterpreter::GetPythonCommandsFromIOHandler | ( | const char * | prompt, |
IOHandlerDelegate & | delegate, | ||
void * | baton = nullptr |
||
) |
Definition at line 3344 of file CommandInterpreter.cpp.
References GetDebugger(), lldb_private::Debugger::GetUseColor(), lldb_private::IOHandler::PythonCode, and lldb_private::Debugger::RunIOHandlerAsync().
Referenced by CommandObjectCommandsScriptAdd::DoExecute().
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 245 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 273 of file CommandInterpreter.cpp.
Referenced by HandleCommand().
bool CommandInterpreter::GetRequireCommandOverwrite | ( | ) | const |
Definition at line 279 of file CommandInterpreter.cpp.
Referenced by CommandObjectCommandsScriptAdd::DoExecute().
FileSpec CommandInterpreter::GetSaveSessionDirectory | ( | ) | const |
Definition at line 200 of file CommandInterpreter.cpp.
Referenced by SaveTranscript().
bool CommandInterpreter::GetSaveSessionOnQuit | ( | ) | const |
Definition at line 178 of file CommandInterpreter.cpp.
Referenced by lldb_private::Debugger::Destroy().
bool CommandInterpreter::GetSaveTranscript | ( | ) | const |
Definition at line 167 of file CommandInterpreter.cpp.
Referenced by HandleCommand().
bool CommandInterpreter::GetSpaceReplPrompts | ( | ) | const |
Definition at line 267 of file CommandInterpreter.cpp.
Referenced by lldb_private::REPL::IOHandlerInputComplete().
|
static |
Definition at line 125 of file CommandInterpreter.cpp.
Referenced by lldb::SBCommandInterpreter::GetBroadcasterClass(), and GetBroadcasterClass().
llvm::json::Value CommandInterpreter::GetStatistics | ( | ) |
Definition at line 3621 of file CommandInterpreter.cpp.
References m_command_usages.
Referenced by lldb::SBCommandInterpreter::GetStatistics(), and lldb_private::DebuggerStats::ReportStatistics().
bool CommandInterpreter::GetStopCmdSourceOnError | ( | ) | const |
Definition at line 261 of file CommandInterpreter.cpp.
Referenced by HandleCommandsFromFile().
bool CommandInterpreter::GetSynchronous | ( | ) |
Definition at line 2864 of file CommandInterpreter.cpp.
References m_synchronous_execution.
Referenced by CommandObjectPlatformProcessLaunch::DoExecute(), CommandObjectProcessContinue::DoExecute(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), CommandObjectThreadContinue::DoExecute(), CommandObjectThreadUntil::DoExecute(), and lldb_private::Target::Launch().
const StructuredData::Array & CommandInterpreter::GetTranscript | ( | ) | const |
Definition at line 3628 of file CommandInterpreter.cpp.
References m_transcript.
Referenced by lldb::SBCommandInterpreter::GetTranscript(), and lldb_private::DebuggerStats::ReportStatistics().
CommandObject * CommandInterpreter::GetUserCommandObject | ( | llvm::StringRef | cmd, |
StringList * | matches = nullptr , |
||
StringList * | descriptions = nullptr |
||
) | const |
Definition at line 1266 of file CommandInterpreter.cpp.
References lldb_private::AddNamesMatchingPartialString(), lldb_private::StringList::AppendString(), lldb_private::CommandObject::GetCommandName(), lldb_private::CommandObject::GetHelp(), GetUserCommands(), and GetUserMultiwordCommands().
Referenced by lldb_private::CommandCompletions::CompleteModifiableCmdPathArgs().
|
inline |
Definition at line 602 of file CommandInterpreter.h.
References m_user_dict.
Referenced by GetUserCommandObject().
|
inline |
Definition at line 606 of file CommandInterpreter.h.
References m_user_mw_dict.
Referenced by GetUserCommandObject().
bool CommandInterpreter::HandleCommand | ( | const char * | command_line, |
LazyBool | add_to_history, | ||
CommandReturnObject & | result, | ||
bool | force_repeat_command = false |
||
) |
Definition at line 1877 of file CommandInterpreter.cpp.
References lldb_private::StructuredData::Array::AddItem(), lldb_private::CommandReturnObject::AppendError(), lldb_private::CommandReturnObject::AppendErrorWithFormat(), lldb_private::CommandHistory::AppendString(), lldb_private::Commands, elapsed(), lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolYes, lldb::eReturnStatusSuccessFinishNoResult, error(), lldb_private::CommandObject::Execute(), lldb_private::CommandHistory::FindString(), lldb_private::CommandHistory::g_repeat_char, lldb_private::StatsDuration::get(), lldb_private::CommandObject::GetCommandName(), GetDebugger(), lldb_private::CommandReturnObject::GetErrorData(), lldb_private::GetLog(), lldb_private::CommandReturnObject::GetOutputData(), lldb_private::CommandObject::GetRepeatCommand(), GetRepeatPreviousCommand(), GetSaveTranscript(), INTERRUPT_REQUESTED, lldb_private::CommandHistory::IsEmpty(), k_white_space, LLDB_LOGF, LLDB_SCOPED_TIMERF, m_command_history, m_command_source_depth, m_comment_char, m_repeat_command, m_transcript, m_transcript_stream, PreprocessCommand(), ResolveCommandImpl(), lldb_private::CommandReturnObject::SetStatus(), lldb_private::CommandReturnObject::Succeeded(), and lldb_private::CommandObject::WantsRawCommandString().
bool CommandInterpreter::HandleCommand | ( | const char * | command_line, |
LazyBool | add_to_history, | ||
const ExecutionContext & | override_context, | ||
CommandReturnObject & | result | ||
) |
Definition at line 1866 of file CommandInterpreter.cpp.
References HandleCommand(), OverrideExecutionContext(), and RestoreExecutionContext().
Referenced by CommandObjectProcessAttach::DoExecute(), lldb_private::CommandObjectRegexCommand::DoExecute(), HandleCommand(), lldb::SBCommandInterpreter::HandleCommand(), HandleCommands(), lldb_private::REPL::IOHandlerInputComplete(), IOHandlerInputComplete(), and sddarwinlog_private::RunEnableCommand().
void CommandInterpreter::HandleCommands | ( | const StringList & | commands, |
const CommandInterpreterRunOptions & | options, | ||
CommandReturnObject & | result | ||
) |
Definition at line 2578 of file CommandInterpreter.cpp.
References lldb_private::CommandReturnObject::AppendErrorWithFormat(), lldb_private::CommandReturnObject::AppendMessage(), lldb_private::CommandReturnObject::AppendMessageWithFormat(), DidProcessStopAbnormally(), lldb::eReturnStatusSuccessContinuingNoResult, lldb::eReturnStatusSuccessContinuingResult, lldb::eReturnStatusSuccessFinishResult, lldb_private::CommandInterpreterRunOptions::GetAddToHistory(), lldb_private::Debugger::GetAsyncExecution(), lldb_private::CommandReturnObject::GetDidChangeProcessState(), lldb_private::CommandInterpreterRunOptions::GetEchoCommands(), lldb_private::CommandReturnObject::GetErrorData(), lldb_private::CommandReturnObject::GetImmediateErrorStream(), lldb_private::CommandReturnObject::GetImmediateOutputStream(), lldb_private::CommandReturnObject::GetInteractive(), lldb_private::CommandReturnObject::GetOutputData(), lldb_private::CommandInterpreterRunOptions::GetPrintResults(), lldb_private::Debugger::GetPrompt(), lldb_private::StringList::GetSize(), lldb_private::CommandReturnObject::GetStatus(), lldb_private::CommandInterpreterRunOptions::GetStopOnContinue(), lldb_private::CommandInterpreterRunOptions::GetStopOnCrash(), lldb_private::CommandInterpreterRunOptions::GetStopOnError(), lldb_private::StringList::GetStringAtIndex(), lldb_private::Debugger::GetUseColor(), HandleCommand(), lldb_private::CommandInterpreterRunOptions::m_add_to_history, m_command_source_depth, m_debugger, lldb_private::Debugger::SetAsyncExecution(), lldb_private::CommandReturnObject::SetInteractive(), lldb_private::CommandReturnObject::SetStatus(), lldb_private::CommandReturnObject::SetSuppressImmediateOutput(), and lldb_private::CommandReturnObject::Succeeded().
void 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. |
Definition at line 2568 of file CommandInterpreter.cpp.
References HandleCommands(), OverrideExecutionContext(), and RestoreExecutionContext().
Referenced by lldb_private::BreakpointOptions::BreakpointOptionsCallbackFunction(), HandleCommands(), and lldb_private::Target::StopHookCommandLine::HandleStop().
void CommandInterpreter::HandleCommandsFromFile | ( | FileSpec & | file, |
const CommandInterpreterRunOptions & | options, | ||
CommandReturnObject & | result | ||
) |
Definition at line 2719 of file CommandInterpreter.cpp.
References lldb_private::CommandReturnObject::AppendErrorWithFormat(), lldb_private::CommandReturnObject::AppendErrorWithFormatv(), lldb_private::ConstString::AsCString(), lldb_private::IOHandler::CommandInterpreter, lldb_private::FileSpec::CopyByRemovingLastPathComponent(), eHandleCommandFlagEchoCommand, eHandleCommandFlagEchoCommentCommand, eHandleCommandFlagPrintErrors, eHandleCommandFlagPrintResult, eHandleCommandFlagStopOnContinue, eHandleCommandFlagStopOnCrash, eHandleCommandFlagStopOnError, lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolYes, lldb_private::File::eOpenOptionReadOnly, lldb::eReturnStatusSuccessFinishNoResult, error(), lldb_private::Debugger::GetAsyncExecution(), GetDebugger(), lldb_private::FileSpec::GetFilename(), lldb_private::Debugger::GetOutputFile(), lldb_private::FileSpec::GetPath(), lldb_private::Debugger::GetPrompt(), GetStopCmdSourceOnError(), lldb_private::CommandInterpreterRunOptions::GetStopOnCrash(), lldb_private::Debugger::GetUseColor(), lldb_private::FileSystem::Instance(), m_command_source_depth, m_command_source_dirs, m_command_source_flags, lldb_private::CommandInterpreterRunOptions::m_echo_commands, lldb_private::CommandInterpreterRunOptions::m_echo_comment_commands, lldb_private::CommandInterpreterRunOptions::m_print_errors, lldb_private::CommandInterpreterRunOptions::m_print_results, lldb_private::CommandInterpreterRunOptions::m_stop_on_continue, lldb_private::CommandInterpreterRunOptions::m_stop_on_error, lldb_private::FileSystem::Open(), lldb_private::File::Printf(), lldb_private::Debugger::RunIOHandlerSync(), lldb_private::Debugger::SetAsyncExecution(), and lldb_private::CommandReturnObject::SetStatus().
void 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. |
Definition at line 2711 of file CommandInterpreter.cpp.
References HandleCommandsFromFile(), OverrideExecutionContext(), and RestoreExecutionContext().
Referenced by CommandObjectCommandsSource::DoExecute(), CommandObjectSettingsRead::DoExecute(), HandleCommandsFromFile(), lldb::SBCommandInterpreter::HandleCommandsFromFile(), and SourceInitFile().
void CommandInterpreter::HandleCompletion | ( | CompletionRequest & | request | ) |
Definition at line 2140 of file CommandInterpreter.cpp.
References lldb_private::CompletionRequest::AddCompletion(), lldb_private::CommandHistory::FindString(), lldb_private::CommandHistory::g_repeat_char, lldb_private::Args::GetArgumentAtIndex(), lldb_private::CompletionRequest::GetParsedLine(), HandleCompletionMatches(), m_command_history, m_comment_char, and lldb_private::RewriteLine.
Referenced by lldb::SBCommandInterpreter::HandleCompletionWithDescriptions(), lldb_private::IOHandlerDelegate::IOHandlerComplete(), and lldb_private::REPL::IOHandlerComplete().
void CommandInterpreter::HandleCompletionMatches | ( | CompletionRequest & | request | ) |
Definition at line 2093 of file CommandInterpreter.cpp.
References lldb_private::CompletionRequest::AddCompletions(), lldb_private::CompletionRequest::AppendEmptyArgument(), lldb_private::StringList::DeleteStringAtIndex(), lldb_private::Args::GetArgumentAtIndex(), lldb_private::Args::GetArgumentCount(), GetCommandNamesMatchingPartialString(), GetCommandObject(), lldb_private::CompletionRequest::GetCursorIndex(), lldb_private::CompletionRequest::GetParsedLine(), lldb_private::StringList::GetSize(), lldb_private::StringList::GetStringAtIndex(), lldb_private::CommandObject::HandleCompletion(), lldb_private::CommandObject::IsMultiwordObject(), and lldb_private::CompletionRequest::ShiftArguments().
Referenced by HandleCompletion(), and lldb_private::CommandObjectHelp::HandleCompletion().
bool CommandInterpreter::HasAliases | ( | ) | const |
Definition at line 2207 of file CommandInterpreter.cpp.
References m_alias_dict.
Referenced by GetCommandSP(), lldb::SBCommandInterpreter::HasAliases(), and HasAliasOptions().
bool CommandInterpreter::HasAliasOptions | ( | ) | const |
Definition at line 2215 of file CommandInterpreter.cpp.
References HasAliases().
Referenced by lldb::SBCommandInterpreter::HasAliasOptions().
bool CommandInterpreter::HasCommands | ( | ) | const |
Definition at line 2205 of file CommandInterpreter.cpp.
References m_command_dict.
Referenced by GetCommandSP(), CommandObjectCommandsUnalias::HandleArgumentCompletion(), CommandObjectCommandsDelete::HandleArgumentCompletion(), and lldb::SBCommandInterpreter::HasCommands().
bool CommandInterpreter::HasUserCommands | ( | ) | const |
Definition at line 2209 of file CommandInterpreter.cpp.
References m_user_dict.
Referenced by CommandObjectCommandsScriptDelete::DoExecute(), and GetCommandSP().
bool CommandInterpreter::HasUserMultiwordCommands | ( | ) | const |
Definition at line 2211 of file CommandInterpreter.cpp.
References m_user_mw_dict.
Referenced by CommandObjectCommandsScriptDelete::DoExecute(), and GetCommandSP().
|
inline |
Definition at line 665 of file CommandInterpreter.h.
References lldb_private::CommandObject::GetCommandName(), and m_command_usages.
Referenced by CommandObjectPythonFunction::DoExecute(), and lldb_private::CommandObjectParsed::Execute().
void CommandInterpreter::Initialize | ( | ) |
Definition at line 285 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().
bool CommandInterpreter::InterruptCommand | ( | ) |
Definition at line 3067 of file CommandInterpreter.cpp.
References eInProgress, eInterrupted, and m_command_state.
Referenced by lldb::SBCommandInterpreter::InterruptCommand(), and IOHandlerInterrupt().
|
inlineoverrideprotectedvirtual |
Reimplemented from lldb_private::IOHandlerDelegate.
Definition at line 683 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.
Definition at line 3123 of file CommandInterpreter.cpp.
References DidProcessStopAbnormally(), EchoCommandNonInteractive(), lldb::eCommandInterpreterResultCommandError, lldb::eCommandInterpreterResultInferiorCrash, lldb::eCommandInterpreterResultQuitRequested, lldb::eCommandInterpreterResultSuccess, eHandleCommandFlagAllowRepeats, eHandleCommandFlagPrintErrors, eHandleCommandFlagPrintResult, eHandleCommandFlagStopOnContinue, eHandleCommandFlagStopOnCrash, eHandleCommandFlagStopOnError, lldb_private::eLazyBoolCalculate, lldb::eReturnStatusFailed, lldb::eReturnStatusInvalid, lldb::eReturnStatusQuit, lldb::eReturnStatusStarted, lldb::eReturnStatusSuccessContinuingNoResult, lldb::eReturnStatusSuccessContinuingResult, lldb::eReturnStatusSuccessFinishNoResult, lldb::eReturnStatusSuccessFinishResult, error(), FinishHandlingCommand(), lldb_private::IOHandler::GetFlags(), lldb_private::IOHandler::GetIsInteractive(), lldb_private::IOHandler::GetOutputMutex(), lldb_private::IOHandler::GetOutputStreamFileSP(), GetProcessOutput(), lldb_private::IOHandler::GetPrompt(), lldb_private::Debugger::GetSelectedExecutionContext(), lldb_private::Debugger::GetUseColor(), HandleCommand(), lldb_private::ExecutionContext::HasTargetScope(), lldb_private::CommandInterpreterRunResult::IncrementNumberOfErrors(), lldb_private::CommandInterpreterRunResult::IsResult(), m_debugger, m_result, OverrideExecutionContext(), PrintCommandOutput(), RestoreExecutionContext(), lldb_private::IOHandler::SetIsDone(), lldb_private::CommandInterpreterRunResult::SetResult(), StartHandlingCommand(), lldb_private::Flags::Test(), and WasInterrupted().
|
overridevirtual |
Reimplemented from lldb_private::IOHandlerDelegate.
Definition at line 3227 of file CommandInterpreter.cpp.
References GetExecutionContext(), lldb_private::ExecutionContext::GetProcessPtr(), lldb_private::Debugger::GetScriptInterpreter(), lldb_private::Process::GetState(), lldb_private::Process::Halt(), lldb_private::ScriptInterpreter::Interrupt(), InterruptCommand(), m_debugger, and lldb_private::StateIsRunningState().
bool CommandInterpreter::IsActive | ( | ) |
Definition at line 3363 of file CommandInterpreter.cpp.
References lldb_private::Debugger::IsTopIOHandler(), m_command_io_handler_sp, and m_debugger.
Referenced by lldb::SBCommandInterpreter::IsActive().
bool CommandInterpreter::IsInteractive | ( | ) |
Definition at line 3315 of file CommandInterpreter.cpp.
References GetIOHandler().
Referenced by lldb::SBCommandInterpreter::IsInteractive().
void CommandInterpreter::LoadCommandDictionary | ( | ) |
Definition at line 557 of file CommandInterpreter.cpp.
References lldb::eSourceFileCompletion, lldb::eSymbolCompletion, LLDB_SCOPED_TIMER, m_command_dict, and REGISTER_COMMAND_OBJECT.
Referenced by Initialize().
void CommandInterpreter::OutputFormattedHelpText | ( | Stream & | stream, |
llvm::StringRef | command_word, | ||
llvm::StringRef | separator, | ||
llvm::StringRef | help_text, | ||
size_t | max_word_len | ||
) |
Definition at line 2914 of file CommandInterpreter.cpp.
References lldb_private::StreamString::GetString(), OutputFormattedHelpText(), and lldb_private::Stream::Printf().
void CommandInterpreter::OutputFormattedHelpText | ( | Stream & | strm, |
llvm::StringRef | prefix, | ||
llvm::StringRef | help_text | ||
) |
Definition at line 2870 of file CommandInterpreter.cpp.
References lldb_private::Stream::EOL(), lldb_private::Debugger::GetTerminalWidth(), lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), m_debugger, and lldb_private::Stream::PutCString().
Referenced by lldb_private::CommandObjectApropos::DoExecute(), lldb_private::Property::DumpDescription(), lldb_private::CommandObject::FormatLongHelpText(), lldb_private::CommandObjectMultiword::GenerateHelpText(), lldb_private::CommandObject::GenerateHelpText(), lldb_private::CommandObject::GetArgumentHelp(), GetHelp(), and OutputFormattedHelpText().
void CommandInterpreter::OutputHelpText | ( | Stream & | stream, |
llvm::StringRef | command_word, | ||
llvm::StringRef | separator, | ||
llvm::StringRef | help_text, | ||
uint32_t | max_word_len | ||
) |
Definition at line 2925 of file CommandInterpreter.cpp.
References lldb_private::Stream::EOL(), lldb_private::StreamString::GetString(), lldb_private::Debugger::GetTerminalWidth(), lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), m_debugger, lldb_private::Stream::Printf(), and lldb_private::Stream::PutChar().
Referenced by lldb_private::CommandObject::GetArgumentHelp().
|
private |
Definition at line 3033 of file CommandInterpreter.cpp.
References m_overriden_exe_contexts.
Referenced by HandleCommand(), HandleCommands(), HandleCommandsFromFile(), and IOHandlerInputComplete().
Status CommandInterpreter::PreprocessCommand | ( | std::string & | command | ) |
Definition at line 1746 of file CommandInterpreter.cpp.
References error(), and PreprocessToken().
Referenced by HandleCommand().
Status CommandInterpreter::PreprocessToken | ( | std::string & | token | ) |
Definition at line 1799 of file CommandInterpreter.cpp.
References lldb::eExpressionCompleted, error(), lldb_private::Target::EvaluateExpression(), lldb_private::StreamString::GetData(), lldb_private::Debugger::GetDummyTarget(), GetExecutionContext(), lldb_private::ExecutionContext::GetFramePtr(), lldb_private::StreamString::GetSize(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::Scalar::GetValue(), m_debugger, lldb_private::EvaluateExpressionOptions::SetCoerceToId(), lldb_private::EvaluateExpressionOptions::SetIgnoreBreakpoints(), lldb_private::EvaluateExpressionOptions::SetKeepInMemory(), lldb_private::EvaluateExpressionOptions::SetTimeout(), lldb_private::EvaluateExpressionOptions::SetTryAllThreads(), lldb_private::EvaluateExpressionOptions::SetUnwindOnError(), and lldb_private::toString().
Referenced by lldb_private::CommandObjectParsed::Execute(), and PreprocessCommand().
|
private |
Definition at line 3083 of file CommandInterpreter.cpp.
References GetDebugger(), lldb_private::IOHandler::GetErrorStreamFileSP(), lldb_private::IOHandler::GetOutputMutex(), lldb_private::IOHandler::GetOutputStreamFileSP(), and INTERRUPT_REQUESTED.
Referenced by IOHandlerInputComplete().
|
inline |
Definition at line 537 of file CommandInterpreter.h.
References eUnwarnedOmission, eWarnedOmission, m_max_depth_warning, m_truncation_warning, and lldb_private::Stream::Printf().
Referenced by CommandObjectTargetVariable::DoExecute(), and CommandObjectFrameVariable::DoExecute().
const char * CommandInterpreter::ProcessEmbeddedScriptCommands | ( | const char * | arg | ) |
Definition at line 541 of file CommandInterpreter.cpp.
bool CommandInterpreter::RemoveAlias | ( | llvm::StringRef | alias_name | ) |
Definition at line 1401 of file CommandInterpreter.cpp.
References m_alias_dict.
Referenced by CommandObjectCommandsUnalias::DoExecute().
|
inline |
Definition at line 360 of file CommandInterpreter.h.
References m_user_dict.
Referenced by CommandObjectCommandsScriptClear::DoExecute().
|
inline |
Definition at line 356 of file CommandInterpreter.h.
References m_user_mw_dict.
bool CommandInterpreter::RemoveCommand | ( | llvm::StringRef | cmd, |
bool | force = false |
||
) |
Remove a command if it is removable (python or regex command).
If force is provided, the command is removed regardless of its removable status.
Definition at line 1410 of file CommandInterpreter.cpp.
References m_command_dict.
Referenced by CommandObjectCommandsDelete::DoExecute().
bool CommandInterpreter::RemoveUser | ( | llvm::StringRef | alias_name | ) |
Definition at line 1423 of file CommandInterpreter.cpp.
References m_user_dict.
Referenced by CommandObjectCommandsScriptDelete::DoExecute().
bool CommandInterpreter::RemoveUserMultiword | ( | llvm::StringRef | multiword_name | ) |
Definition at line 1433 of file CommandInterpreter.cpp.
References m_user_mw_dict.
Referenced by CommandObjectCommandsContainerDelete::DoExecute().
void CommandInterpreter::ResolveCommand | ( | const char * | command_line, |
CommandReturnObject & | result | ||
) |
Definition at line 252 of file CommandInterpreter.cpp.
References lldb_private::CommandReturnObject::AppendMessageWithFormat(), lldb::eReturnStatusSuccessFinishResult, ResolveCommandImpl(), and lldb_private::CommandReturnObject::SetStatus().
Referenced by lldb::SBCommandInterpreter::ResolveCommand().
|
private |
Definition at line 3444 of file CommandInterpreter.cpp.
References lldb_private::CommandReturnObject::AppendErrorWithFormat(), lldb_private::CommandReturnObject::AppendRawError(), BuildAliasResult(), lldb_private::StreamString::Clear(), lldb_private::StringList::Clear(), ExtractCommand(), FindArgumentTerminator(), GetAliasCommandObject(), GetAliasFullName(), lldb_private::CommandObject::GetCommandName(), GetCommandObject(), lldb_private::CommandObject::GetOptions(), lldb_private::StringList::GetSize(), lldb_private::StreamString::GetString(), lldb_private::StringList::GetStringAtIndex(), lldb_private::CommandObject::GetSubcommandObject(), lldb_private::CommandObject::IsAlias(), lldb_private::CommandObject::IsMultiwordObject(), lldbassert, lldb_private::Stream::Printf(), lldb_private::Stream::PutCString(), lldb_private::Options::SupportsLongOption(), and lldb_private::CommandObject::WantsRawCommandString().
Referenced by HandleCommand(), and ResolveCommand().
|
private |
Definition at line 3038 of file CommandInterpreter.cpp.
References m_overriden_exe_contexts.
Referenced by HandleCommand(), HandleCommands(), HandleCommandsFromFile(), and IOHandlerInputComplete().
CommandInterpreterRunResult CommandInterpreter::RunCommandInterpreter | ( | CommandInterpreterRunOptions & | options | ) |
Definition at line 3414 of file CommandInterpreter.cpp.
References lldb_private::CommandInterpreterRunOptions::GetAutoHandleEvents(), lldb_private::Host::GetCurrentThread(), GetIOHandler(), lldb_private::CommandInterpreterRunOptions::GetSpawnThread(), m_debugger, m_result, lldb_private::Debugger::RunIOHandlerAsync(), lldb_private::Debugger::RunIOHandlers(), lldb_private::Debugger::SetIOHandlerThread(), lldb_private::Debugger::StartEventHandlerThread(), lldb_private::Debugger::StartIOHandlerThread(), and lldb_private::Debugger::StopEventHandlerThread().
Referenced by lldb::SBDebugger::RunCommandInterpreter().
bool 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. |
Definition at line 3251 of file CommandInterpreter.cpp.
References lldb_private::CommandReturnObject::AppendError(), lldb_private::CommandReturnObject::AppendErrorWithFormatv(), lldb_private::CommandReturnObject::AppendMessageWithFormat(), lldb_private::FileSpec::AppendPathComponent(), lldb_private::Commands, lldb_private::File::eOpenOptionCanCreate, lldb_private::File::eOpenOptionTruncate, lldb_private::File::eOpenOptionWriteOnly, lldb::eReturnStatusSuccessFinishNoResult, error(), lldb_private::StreamString::GetData(), lldb_private::Debugger::GetExternalEditor(), lldb_private::GetLog(), GetOpenTranscriptInEditor(), lldb_private::FileSpec::GetPath(), GetSaveSessionDirectory(), lldb_private::StreamString::GetSize(), lldb_private::FileSystem::Instance(), lldb_private::Host::IsInteractiveGraphicSession(), LLDB_LOG, m_debugger, m_transcript_stream, lldb_private::FileSystem::Open(), lldb_private::Host::OpenFileInExternalEditor(), lldb_private::FileSystem::Resolve(), and lldb_private::CommandReturnObject::SetStatus().
Referenced by lldb_private::Debugger::Destroy(), and CommandObjectSessionSave::DoExecute().
|
inline |
Definition at line 521 of file CommandInterpreter.h.
References m_batch_command_mode.
Referenced by SourceInitFile().
void CommandInterpreter::SetEchoCommands | ( | bool | enable | ) |
Definition at line 216 of file CommandInterpreter.cpp.
References lldb_private::Properties::SetPropertyAtIndex().
void CommandInterpreter::SetEchoCommentCommands | ( | bool | enable | ) |
Definition at line 227 of file CommandInterpreter.cpp.
References lldb_private::Properties::SetPropertyAtIndex().
void CommandInterpreter::SetOpenTranscriptInEditor | ( | bool | enable | ) |
Definition at line 195 of file CommandInterpreter.cpp.
References lldb_private::Properties::SetPropertyAtIndex().
void CommandInterpreter::SetPromptOnQuit | ( | bool | enable | ) |
Definition at line 162 of file CommandInterpreter.cpp.
References lldb_private::Properties::SetPropertyAtIndex().
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 238 of file CommandInterpreter.cpp.
References m_allow_exit_code, and m_quit_exit_code.
Referenced by lldb_private::CommandObjectQuit::DoExecute().
|
inline |
Definition at line 532 of file CommandInterpreter.h.
References eNoOmission, eUnwarnedOmission, and m_max_depth_warning.
void CommandInterpreter::SetSaveSessionDirectory | ( | llvm::StringRef | path | ) |
Definition at line 205 of file CommandInterpreter.cpp.
References lldb_private::Properties::SetPropertyAtIndex().
void CommandInterpreter::SetSaveSessionOnQuit | ( | bool | enable | ) |
Definition at line 184 of file CommandInterpreter.cpp.
References lldb_private::Properties::SetPropertyAtIndex().
void CommandInterpreter::SetSaveTranscript | ( | bool | enable | ) |
Definition at line 173 of file CommandInterpreter.cpp.
References lldb_private::Properties::SetPropertyAtIndex().
|
protected |
Definition at line 2866 of file CommandInterpreter.cpp.
References m_synchronous_execution.
Referenced by CommandInterpreter().
|
inline |
Definition at line 506 of file CommandInterpreter.h.
References m_skip_app_init_files.
Referenced by lldb::SBDebugger::Create().
|
inline |
Definition at line 502 of file CommandInterpreter.h.
References m_skip_lldbinit_files.
Referenced by lldb::SBDebugger::Create().
|
private |
Definition at line 2398 of file CommandInterpreter.cpp.
References lldb::eReturnStatusSuccessFinishNoResult, HandleCommandsFromFile(), lldb_private::FileSystem::Instance(), m_skip_lldbinit_files, SetBatchCommandMode(), lldb_private::CommandInterpreterRunOptions::SetPrintErrors(), lldb_private::CommandInterpreterRunOptions::SetSilent(), lldb_private::CommandReturnObject::SetStatus(), lldb_private::CommandInterpreterRunOptions::SetStopOnContinue(), and lldb_private::CommandInterpreterRunOptions::SetStopOnError().
Referenced by SourceInitFileCwd(), SourceInitFileGlobal(), and SourceInitFileHome().
void CommandInterpreter::SourceInitFileCwd | ( | CommandReturnObject & | result | ) |
Definition at line 2420 of file CommandInterpreter.cpp.
References lldb_private::CommandReturnObject::AppendError(), lldb_private::eLoadCWDlldbinitFalse, lldb_private::eLoadCWDlldbinitTrue, lldb_private::eLoadCWDlldbinitWarn, lldb::eReturnStatusSuccessFinishNoResult, GetCwdInitFile(), lldb_private::Target::GetGlobalProperties(), GetHomeInitFile(), lldb_private::TargetProperties::GetLoadCWDlldbinitFile(), InitFileWarning, lldb_private::FileSystem::Instance(), m_skip_lldbinit_files, lldb_private::CommandReturnObject::SetStatus(), and SourceInitFile().
Referenced by lldb::SBCommandInterpreter::SourceInitFileInCurrentWorkingDirectory().
void CommandInterpreter::SourceInitFileGlobal | ( | CommandReturnObject & | result | ) |
Definition at line 2487 of file CommandInterpreter.cpp.
References lldb_private::FileSpec::AppendPathComponent(), lldb::eReturnStatusSuccessFinishNoResult, m_skip_lldbinit_files, lldb_private::FileSpec::MakeAbsolute(), lldb_private::CommandReturnObject::SetStatus(), and SourceInitFile().
Referenced by lldb::SBCommandInterpreter::SourceInitFileInGlobalDirectory().
void CommandInterpreter::SourceInitFileHome | ( | CommandReturnObject & | result, |
bool | is_repl | ||
) |
We will first see if there is an application specific ".lldbinit" file whose name is "~/.lldbinit" followed by a "-" and the name of the program.
If this file doesn't exist, we fall back to the REPL init file or the default home init file in "~/.lldbinit".
Definition at line 2460 of file CommandInterpreter.cpp.
References lldb::eReturnStatusSuccessFinishNoResult, GetDebugger(), GetHomeInitFile(), GetHomeREPLInitFile(), lldb_private::FileSystem::Instance(), m_skip_app_init_files, m_skip_lldbinit_files, lldb_private::CommandReturnObject::SetStatus(), and SourceInitFile().
Referenced by lldb::SBCommandInterpreter::SourceInitFileInHomeDirectory().
|
private |
Definition at line 3049 of file CommandInterpreter.cpp.
References eIdle, eInProgress, lldbassert, m_command_state, and m_iohandler_nesting_level.
Referenced by IOHandlerInputComplete().
void CommandInterpreter::UpdatePrompt | ( | llvm::StringRef | prompt | ) |
Definition at line 2173 of file CommandInterpreter.cpp.
References lldb_private::Broadcaster::BroadcastEvent(), eBroadcastBitResetPrompt, lldb_private::Broadcaster::Event, and m_command_io_handler_sp.
Referenced by lldb_private::Debugger::SetPrompt(), and lldb_private::Debugger::SetPropertyValue().
bool CommandInterpreter::UserCommandExists | ( | llvm::StringRef | cmd | ) | const |
Determine whether a root-level user command with this name exists.
Definition at line 1373 of file CommandInterpreter.cpp.
References m_user_dict.
Referenced by AddUserCommand(), and lldb::SBCommandInterpreter::UserCommandExists().
bool CommandInterpreter::UserMultiwordCommandExists | ( | llvm::StringRef | cmd | ) | const |
Determine whether a root-level user multiword command with this name exists.
Definition at line 1377 of file CommandInterpreter.cpp.
References m_user_mw_dict.
CommandObjectMultiword * 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. |
Definition at line 956 of file CommandInterpreter.cpp.
References lldb_private::Status::Clear(), lldb_private::Args::GetArgumentAtIndex(), lldb_private::Args::GetArgumentCount(), lldb_private::CommandObjectMultiword::GetAsMultiwordCommand(), GetCommandSPExact(), lldb_private::CommandObjectMultiword::GetSubcommandSPExact(), lldb_private::Status::SetErrorString(), and lldb_private::Status::SetErrorStringWithFormat().
Referenced by lldb_private::CommandCompletions::CompleteModifiableCmdPathArgs(), CommandObjectCommandsScriptAdd::DoExecute(), CommandObjectCommandsScriptDelete::DoExecute(), CommandObjectCommandsContainerAdd::DoExecute(), and CommandObjectCommandsContainerDelete::DoExecute().
|
protected |
Definition at line 3073 of file CommandInterpreter.cpp.
References eInterrupted, lldb_private::Debugger::IsIOHandlerThreadCurrentThread(), lldbassert, m_command_state, m_debugger, and m_iohandler_nesting_level.
Referenced by lldb_private::Debugger::InterruptRequested(), and IOHandlerInputComplete().
|
friend |
Definition at line 673 of file CommandInterpreter.h.
|
static |
Definition at line 263 of file CommandInterpreter.h.
Referenced by BuildAliasCommandArgs(), BuildAliasResult(), lldb_private::CommandAlias::GetAliasExpansion(), lldb_private::CommandAlias::IsDashDashCommand(), and ProcessAliasOptionsArgs().
|
static |
Definition at line 262 of file CommandInterpreter.h.
Referenced by lldb_private::CommandAlias::GetAliasExpansion().
|
static |
Definition at line 261 of file CommandInterpreter.h.
Referenced by BuildAliasCommandArgs(), lldb_private::CommandAlias::GetAliasExpansion(), and lldb_private::Options::ParseAlias().
|
private |
Definition at line 753 of file CommandInterpreter.h.
Referenced by AddAlias(), AliasExists(), FindCommandsForApropos(), GetAlias(), GetAliases(), GetAliasFullName(), GetCommandNamesMatchingPartialString(), GetCommandSP(), GetHelp(), HasAliases(), and RemoveAlias().
|
private |
Definition at line 783 of file CommandInterpreter.h.
Referenced by AllowExitCodeOnQuit(), and SetQuitExitCode().
|
private |
Definition at line 762 of file CommandInterpreter.h.
Referenced by GetBatchCommandMode(), and SetBatchCommandMode().
|
private |
Definition at line 749 of file CommandInterpreter.h.
Referenced by AddCommand(), CommandExists(), FindCommandsForApropos(), GetCommandNamesMatchingPartialString(), GetCommands(), GetCommandSP(), GetHelp(), HasCommands(), LoadCommandDictionary(), and RemoveCommand().
|
private |
Definition at line 757 of file CommandInterpreter.h.
Referenced by GetAutoSuggestionForCommand(), GetCommandHistory(), HandleCommand(), and HandleCompletion().
|
private |
Definition at line 760 of file CommandInterpreter.h.
Referenced by Clear(), GetIOHandler(), IsActive(), and UpdatePrompt().
|
private |
Definition at line 772 of file CommandInterpreter.h.
Referenced by HandleCommand(), HandleCommands(), and HandleCommandsFromFile().
|
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 775 of file CommandInterpreter.h.
Referenced by GetCurrentSourceDir(), and HandleCommandsFromFile().
|
private |
Definition at line 776 of file CommandInterpreter.h.
Referenced by HandleCommandsFromFile().
|
private |
Definition at line 733 of file CommandInterpreter.h.
Referenced by FinishHandlingCommand(), InterruptCommand(), StartHandlingCommand(), and WasInterrupted().
|
private |
Definition at line 787 of file CommandInterpreter.h.
Referenced by GetStatistics(), and IncreaseCommandUsage().
|
private |
Definition at line 761 of file CommandInterpreter.h.
Referenced by EchoCommandNonInteractive(), HandleCommand(), and HandleCompletion().
|
private |
Definition at line 741 of file CommandInterpreter.h.
Referenced by Confirm(), GetDebugger(), GetExecutionContext(), GetIOHandler(), GetPlatform(), GetProcessOutput(), HandleCommands(), Initialize(), IOHandlerInputComplete(), IOHandlerInterrupt(), IsActive(), OutputFormattedHelpText(), OutputHelpText(), PreprocessToken(), RunCommandInterpreter(), SaveTranscript(), and WasInterrupted().
|
private |
Definition at line 736 of file CommandInterpreter.h.
Referenced by FinishHandlingCommand(), StartHandlingCommand(), and WasInterrupted().
|
private |
Whether we reached the maximum child nesting depth and whether the user has been told.
Definition at line 768 of file CommandInterpreter.h.
Referenced by PrintWarningsIfNecessary(), and SetReachedMaximumDepth().
|
private |
Definition at line 745 of file CommandInterpreter.h.
Referenced by GetExecutionContext(), OverrideExecutionContext(), and RestoreExecutionContext().
|
private |
Definition at line 781 of file CommandInterpreter.h.
Referenced by AllowExitCodeOnQuit(), GetQuitExitCode(), and SetQuitExitCode().
|
private |
Definition at line 758 of file CommandInterpreter.h.
Referenced by HandleCommand().
|
private |
Definition at line 777 of file CommandInterpreter.h.
Referenced by IOHandlerInputComplete(), and RunCommandInterpreter().
|
private |
Definition at line 748 of file CommandInterpreter.h.
Referenced by SkipAppInitFiles(), and SourceInitFileHome().
|
private |
Definition at line 747 of file CommandInterpreter.h.
Referenced by SkipLLDBInitFiles(), SourceInitFile(), SourceInitFileCwd(), SourceInitFileGlobal(), and SourceInitFileHome().
|
private |
Definition at line 746 of file CommandInterpreter.h.
Referenced by GetSynchronous(), and SetSynchronous().
|
private |
Contains a list of handled commands and their details.
Each element in the list is a dictionary with the following keys/values:
Turn on settings interpreter.save-transcript
for LLDB to populate this list. Otherwise this list is empty.
Definition at line 806 of file CommandInterpreter.h.
Referenced by GetTranscript(), and HandleCommand().
|
private |
Turn on settings interpreter.save-transcript
for LLDB to populate this stream.
Otherwise this stream is empty.
Definition at line 791 of file CommandInterpreter.h.
Referenced by HandleCommand(), and SaveTranscript().
|
private |
Whether we truncated a value's list of children and whether the user has been told.
Definition at line 765 of file CommandInterpreter.h.
Referenced by ChildrenTruncated(), and PrintWarningsIfNecessary().
|
private |
Definition at line 754 of file CommandInterpreter.h.
Referenced by AddUserCommand(), FindCommandsForApropos(), GetCommandSP(), GetHelp(), GetUserCommands(), HasUserCommands(), RemoveAllUser(), RemoveUser(), and UserCommandExists().
|
private |
Definition at line 756 of file CommandInterpreter.h.
Referenced by AddUserCommand(), FindCommandsForApropos(), GetCommandSP(), GetHelp(), GetUserMultiwordCommands(), HasUserMultiwordCommands(), RemoveAllUserMultiword(), RemoveUserMultiword(), and UserMultiwordCommandExists().