LLDB  mainline
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
lldb_private::CommandInterpreter Class Reference

#include <CommandInterpreter.h>

Inheritance diagram for lldb_private::CommandInterpreter:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::CommandInterpreter:
Collaboration graph
[legend]

Public Types

enum  {
  eBroadcastBitThreadShouldExit = (1 << 0), eBroadcastBitResetPrompt = (1 << 1), eBroadcastBitQuitCommandReceived = (1 << 2), eBroadcastBitAsynchronousOutputData = (1 << 3),
  eBroadcastBitAsynchronousErrorData = (1 << 4)
}
 
enum  ChildrenTruncatedWarningStatus { eNoTruncation = 0, eUnwarnedTruncation = 1, eWarnedTruncation = 2 }
 
enum  CommandTypes {
  eCommandTypesBuiltin = 0x0001, eCommandTypesUserDef = 0x0002, eCommandTypesAliases = 0x0004, eCommandTypesHidden = 0x0008,
  eCommandTypesAllThem = 0xFFFF
}
 
- Public Types inherited from lldb_private::IOHandlerDelegate
enum  Completion { Completion::None, Completion::LLDBCommand, Completion::Expression }
 

Public Member Functions

 CommandInterpreter (Debugger &debugger, bool synchronous_execution)
 
 ~CommandInterpreter () override
 
ConstStringGetBroadcasterClass () const override
 
void SourceInitFile (bool in_cwd, CommandReturnObject &result)
 
bool AddCommand (llvm::StringRef name, const lldb::CommandObjectSP &cmd_sp, bool can_replace)
 
bool AddUserCommand (llvm::StringRef name, const lldb::CommandObjectSP &cmd_sp, bool can_replace)
 
lldb::CommandObjectSP GetCommandSPExact (llvm::StringRef cmd, bool include_aliases) const
 
CommandObjectGetCommandObject (llvm::StringRef cmd, StringList *matches=nullptr, StringList *descriptions=nullptr) const
 
bool CommandExists (llvm::StringRef cmd) const
 
bool AliasExists (llvm::StringRef cmd) const
 
bool UserCommandExists (llvm::StringRef cmd) const
 
CommandAliasAddAlias (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 RemoveUser (llvm::StringRef alias_name)
 
void RemoveAllUser ()
 
const CommandAliasGetAlias (llvm::StringRef alias_name) const
 
CommandObjectBuildAliasResult (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, CommandReturnObject &result, ExecutionContext *override_context=nullptr, bool repeat_on_empty_command=true, bool no_context_switching=false)
 
bool WasInterrupted () const
 
void HandleCommands (const StringList &commands, ExecutionContext *context, CommandInterpreterRunOptions &options, CommandReturnObject &result)
 Execute a list of commands in sequence. More...
 
void HandleCommandsFromFile (FileSpec &file, ExecutionContext *context, CommandInterpreterRunOptions &options, CommandReturnObject &result)
 Execute a list of commands from a file. More...
 
CommandObjectGetCommandObjectForCommand (llvm::StringRef &command_line)
 
int HandleCompletion (const char *current_line, const char *cursor, const char *last_char, int match_start_point, int max_return_elements, StringList &matches, StringList &descriptions)
 
int 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)
 
DebuggerGetDebugger ()
 
ExecutionContext GetExecutionContext ()
 
void UpdateExecutionContext (ExecutionContext *override_context)
 
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 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)
 
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 GetBatchCommandMode ()
 
bool SetBatchCommandMode (bool value)
 
void ChildrenTruncated ()
 
bool TruncationWarningNecessary ()
 
void TruncationWarningGiven ()
 
const char * TruncationWarningText ()
 
const CommandHistoryGetCommandHistory () const
 
CommandHistoryGetCommandHistory ()
 
bool IsActive ()
 
void RunCommandInterpreter (bool auto_handle_events, bool spawn_thread, CommandInterpreterRunOptions &options)
 
void GetLLDBCommandsFromIOHandler (const char *prompt, IOHandlerDelegate &delegate, bool asynchronously, void *baton)
 
void GetPythonCommandsFromIOHandler (const char *prompt, IOHandlerDelegate &delegate, bool asynchronously, void *baton)
 
const char * GetCommandPrefix ()
 
bool GetExpandRegexAliases () const
 
bool GetPromptOnQuit () const
 
void SetPromptOnQuit (bool b)
 
bool GetEchoCommands () const
 
void SetEchoCommands (bool b)
 
bool GetEchoCommentCommands () const
 
void SetEchoCommentCommands (bool b)
 
void AllowExitCodeOnQuit (bool allow)
 Specify if the command interpreter should allow that the user can specify a custom exit code when calling 'quit'. More...
 
LLVM_NODISCARD 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
 
uint32_t GetNumErrors () const
 
bool GetQuitRequested () const
 
lldb::IOHandlerSP GetIOHandler (bool force_create=false, CommandInterpreterRunOptions *options=nullptr)
 
bool GetStoppedForCrash () const
 
bool GetSpaceReplPrompts () const
 
- Public Member Functions inherited from lldb_private::Broadcaster
 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 ()
 
- 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, 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)
 
virtual void DumpAllPropertyValues (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
 
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)
 
- 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 int IOHandlerComplete (IOHandler &io_handler, const char *current_line, const char *cursor, const char *last_char, int skip_first_n_matches, int max_matches, StringList &matches, StringList &descriptions)
 
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 ConstStringGetStaticBroadcasterClass ()
 
- Static Public Member Functions inherited from lldb_private::Properties
static const char * GetExperimentalSettingsName ()
 
static bool IsSettingExperimental (llvm::StringRef setting)
 

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
 
bool IOHandlerInterrupt (IOHandler &io_handler) override
 
size_t GetProcessOutput ()
 
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 ()
 

Friends

class Debugger
 

Additional Inherited Members

- Protected Types inherited from lldb_private::Broadcaster
typedef std::shared_ptr< BroadcasterImplBroadcasterImplSP
 
typedef std::weak_ptr< BroadcasterImplBroadcasterImplWP
 
- Protected Attributes inherited from lldb_private::Properties
lldb::OptionValuePropertiesSP m_collection_sp
 
- Protected Attributes inherited from lldb_private::IOHandlerDelegate
Completion m_completion
 

Detailed Description

Definition at line 164 of file CommandInterpreter.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
eBroadcastBitThreadShouldExit 
eBroadcastBitResetPrompt 
eBroadcastBitQuitCommandReceived 
eBroadcastBitAsynchronousOutputData 
eBroadcastBitAsynchronousErrorData 

Definition at line 168 of file CommandInterpreter.h.

◆ ChildrenTruncatedWarningStatus

Enumerator
eNoTruncation 
eUnwarnedTruncation 
eWarnedTruncation 

Definition at line 176 of file CommandInterpreter.h.

◆ CommandTypes

Enumerator
eCommandTypesBuiltin 
eCommandTypesUserDef 
eCommandTypesAliases 
eCommandTypesHidden 
eCommandTypesAllThem 

Definition at line 183 of file CommandInterpreter.h.

Constructor & Destructor Documentation

◆ CommandInterpreter()

CommandInterpreter::CommandInterpreter ( Debugger debugger,
bool  synchronous_execution 
)

◆ ~CommandInterpreter()

CommandInterpreter::~CommandInterpreter ( )
override

Definition at line 1903 of file CommandInterpreter.cpp.

Member Function Documentation

◆ AddAlias()

CommandAlias * CommandInterpreter::AddAlias ( llvm::StringRef  alias_name,
lldb::CommandObjectSP &  command_obj_sp,
llvm::StringRef  args_string = llvm::StringRef() 
)

Definition at line 1137 of file CommandInterpreter.cpp.

References lldbassert.

Referenced by Initialize().

◆ AddCommand()

bool CommandInterpreter::AddCommand ( llvm::StringRef  name,
const lldb::CommandObjectSP &  cmd_sp,
bool  can_replace 
)

Definition at line 965 of file CommandInterpreter.cpp.

References lldbassert.

◆ AddUserCommand()

bool CommandInterpreter::AddUserCommand ( llvm::StringRef  name,
const lldb::CommandObjectSP &  cmd_sp,
bool  can_replace 
)

◆ AliasExists()

bool CommandInterpreter::AliasExists ( llvm::StringRef  cmd) const

Definition at line 1128 of file CommandInterpreter.cpp.

Referenced by lldb::SBCommandInterpreter::AliasExists().

◆ AllowExitCodeOnQuit()

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 183 of file CommandInterpreter.cpp.

Referenced by lldb::SBCommandInterpreter::AllowExitCodeOnQuit().

◆ BuildAliasCommandArgs()

void CommandInterpreter::BuildAliasCommandArgs ( CommandObject alias_cmd_obj,
const char *  alias_name,
Args cmd_args,
std::string &  raw_input_string,
CommandReturnObject result 
)

◆ BuildAliasResult()

CommandObject * CommandInterpreter::BuildAliasResult ( llvm::StringRef  alias_name,
std::string &  raw_input_string,
std::string &  alias_result,
CommandReturnObject result 
)

Definition at line 1385 of file CommandInterpreter.cpp.

References lldb_private::CommandReturnObject::AppendErrorWithFormat(), lldb::eExpressionCompleted, lldb::eExpressionDiscarded, lldb::eExpressionHitBreakpoint, lldb::eExpressionInterrupted, lldb::eExpressionParseError, lldb::eExpressionResultUnavailable, lldb::eExpressionSetupError, lldb::eExpressionStoppedForDebug, lldb::eExpressionTimedOut, lldb_private::OptionParser::eNoArgument, lldb_private::OptionParser::eOptionalArgument, lldb::eReturnStatusFailed, lldb_private::Target::EvaluateExpression(), lldb_private::Status::Fail(), lldb_private::Args::GetArgumentAtIndex(), lldb_private::Args::GetArgumentCount(), lldb_private::CommandObject::GetCommandName(), GetCommandObject(), lldb_private::Debugger::GetDummyTarget(), lldb_private::Status::GetError(), GetExecutionContext(), lldb_private::ExecutionContext::GetFramePtr(), GetOptionArgumentPosition(), lldb_private::StreamString::GetSize(), lldb_private::StreamString::GetString(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::Scalar::GetValue(), lldb_private::CommandObject::IsAlias(), lldb_private::None, lldb_private::Stream::Printf(), lldb_private::EvaluateExpressionOptions::SetCoerceToId(), lldb_private::Status::SetErrorStringWithFormat(), lldb_private::EvaluateExpressionOptions::SetIgnoreBreakpoints(), lldb_private::EvaluateExpressionOptions::SetKeepInMemory(), lldb_private::CommandReturnObject::SetStatus(), lldb_private::EvaluateExpressionOptions::SetTimeout(), lldb_private::EvaluateExpressionOptions::SetTryAllThreads(), lldb_private::EvaluateExpressionOptions::SetUnwindOnError(), lldb_private::Status::Success(), and lldb_private::Args::Unshift().

Referenced by RunCommandInterpreter().

◆ ChildrenTruncated()

void lldb_private::CommandInterpreter::ChildrenTruncated ( )
inline

Definition at line 413 of file CommandInterpreter.h.

◆ Clear()

void CommandInterpreter::Clear ( )

Definition at line 439 of file CommandInterpreter.cpp.

◆ CommandExists()

bool CommandInterpreter::CommandExists ( llvm::StringRef  cmd) const

◆ Confirm()

bool CommandInterpreter::Confirm ( llvm::StringRef  message,
bool  default_answer 
)

◆ FindCommandsForApropos()

void CommandInterpreter::FindCommandsForApropos ( llvm::StringRef  word,
StringList commands_found,
StringList commands_help,
bool  search_builtin_commands,
bool  search_user_commands,
bool  search_alias_commands 
)

◆ GetAlias()

const CommandAlias * CommandInterpreter::GetAlias ( llvm::StringRef  alias_name) const

◆ GetAliasFullName()

bool CommandInterpreter::GetAliasFullName ( llvm::StringRef  cmd,
std::string &  full_name 
) const

◆ GetAliasHelp()

void lldb_private::CommandInterpreter::GetAliasHelp ( const char *  alias_name,
StreamString help_string 
)

◆ GetBatchCommandMode()

bool lldb_private::CommandInterpreter::GetBatchCommandMode ( )
inline

◆ GetBroadcasterClass()

ConstString& lldb_private::CommandInterpreter::GetBroadcasterClass ( ) const
inlineoverridevirtual

Reimplemented from lldb_private::Broadcaster.

Definition at line 199 of file CommandInterpreter.h.

◆ GetCommandHistory() [1/2]

const CommandHistory& lldb_private::CommandInterpreter::GetCommandHistory ( ) const
inline

◆ GetCommandHistory() [2/2]

CommandHistory& lldb_private::CommandInterpreter::GetCommandHistory ( )
inline

◆ GetCommandNamesMatchingPartialString()

int CommandInterpreter::GetCommandNamesMatchingPartialString ( const char *  cmd_cstr,
bool  include_aliases,
StringList matches,
StringList descriptions 
)

◆ GetCommandObject()

CommandObject * CommandInterpreter::GetCommandObject ( llvm::StringRef  cmd,
StringList matches = nullptr,
StringList descriptions = nullptr 
) const

◆ GetCommandObjectForCommand()

CommandObject * CommandInterpreter::GetCommandObjectForCommand ( llvm::StringRef &  command_line)

◆ GetCommandPrefix()

const char * CommandInterpreter::GetCommandPrefix ( )

◆ GetCommandSP()

CommandObjectSP CommandInterpreter::GetCommandSP ( llvm::StringRef  cmd,
bool  include_aliases = true,
bool  exact = true,
StringList matches = nullptr,
StringList descriptions = nullptr 
) const
protected

◆ GetCommandSPExact()

CommandObjectSP CommandInterpreter::GetCommandSPExact ( llvm::StringRef  cmd,
bool  include_aliases 
) const

◆ GetDebugger()

Debugger& lldb_private::CommandInterpreter::GetDebugger ( )
inline

◆ GetEchoCommands()

bool CommandInterpreter::GetEchoCommands ( ) const

◆ GetEchoCommentCommands()

bool CommandInterpreter::GetEchoCommentCommands ( ) const

◆ GetExecutionContext()

ExecutionContext lldb_private::CommandInterpreter::GetExecutionContext ( )
inline

◆ GetExpandRegexAliases()

bool CommandInterpreter::GetExpandRegexAliases ( ) const

◆ GetHelp()

void CommandInterpreter::GetHelp ( CommandReturnObject result,
uint32_t  types = eCommandTypesAllThem 
)

◆ GetIOHandler()

lldb::IOHandlerSP CommandInterpreter::GetIOHandler ( bool  force_create = false,
CommandInterpreterRunOptions options = nullptr 
)

◆ GetLLDBCommandsFromIOHandler()

void CommandInterpreter::GetLLDBCommandsFromIOHandler ( const char *  prompt,
IOHandlerDelegate delegate,
bool  asynchronously,
void *  baton 
)

◆ GetNumErrors()

uint32_t lldb_private::CommandInterpreter::GetNumErrors ( ) const
inline

Definition at line 484 of file CommandInterpreter.h.

Referenced by lldb::SBDebugger::RunCommandInterpreter().

◆ GetOptionArgumentPosition()

int CommandInterpreter::GetOptionArgumentPosition ( const char *  in_string)

Definition at line 2067 of file CommandInterpreter.cpp.

Referenced by BuildAliasCommandArgs(), and BuildAliasResult().

◆ GetPlatform()

PlatformSP CommandInterpreter::GetPlatform ( bool  prefer_target_platform)

◆ GetProcessOutput()

size_t CommandInterpreter::GetProcessOutput ( )
protected

◆ GetPromptOnQuit()

bool CommandInterpreter::GetPromptOnQuit ( ) const

◆ GetPythonCommandsFromIOHandler()

void CommandInterpreter::GetPythonCommandsFromIOHandler ( const char *  prompt,
IOHandlerDelegate delegate,
bool  asynchronously,
void *  baton 
)

◆ GetQuitExitCode()

int CommandInterpreter::GetQuitExitCode ( bool &  exited) const

Returns the exit code that the user has specified when running the 'quit' command.

Parameters
[out]exitedSet to true if the user has called quit with a custom exit code.

Definition at line 196 of file CommandInterpreter.cpp.

Referenced by lldb::SBCommandInterpreter::GetQuitStatus(), and lldb::SBCommandInterpreter::HasCustomQuitExitCode().

◆ GetQuitRequested()

bool lldb_private::CommandInterpreter::GetQuitRequested ( ) const
inline

Definition at line 486 of file CommandInterpreter.h.

Referenced by lldb::SBDebugger::RunCommandInterpreter().

◆ GetSpaceReplPrompts()

bool CommandInterpreter::GetSpaceReplPrompts ( ) const

◆ GetStaticBroadcasterClass()

ConstString & CommandInterpreter::GetStaticBroadcasterClass ( )
static

Definition at line 119 of file CommandInterpreter.cpp.

◆ GetStopCmdSourceOnError()

bool CommandInterpreter::GetStopCmdSourceOnError ( ) const

◆ GetStoppedForCrash()

bool lldb_private::CommandInterpreter::GetStoppedForCrash ( ) const
inline

Definition at line 492 of file CommandInterpreter.h.

Referenced by lldb::SBDebugger::RunCommandInterpreter().

◆ GetSynchronous()

bool CommandInterpreter::GetSynchronous ( )

Definition at line 2503 of file CommandInterpreter.cpp.

Referenced by lldb_private::Target::Launch().

◆ HandleCommand()

bool CommandInterpreter::HandleCommand ( const char *  command_line,
LazyBool  add_to_history,
CommandReturnObject result,
ExecutionContext override_context = nullptr,
bool  repeat_on_empty_command = true,
bool  no_context_switching = false 
)

◆ HandleCommands()

void CommandInterpreter::HandleCommands ( const StringList commands,
ExecutionContext context,
CommandInterpreterRunOptions options,
CommandReturnObject result 
)

Execute a list of commands in sequence.

Parameters
[in]commandsThe list of commands to execute.
[in,out]contextThe execution context in which to run the commands. Can be nullptr in which case the default context will be used.
[in]optionsThis object holds the options used to control when to stop, whether to execute commands, etc.
[out]resultThis 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 2208 of file CommandInterpreter.cpp.

References lldb_private::CommandReturnObject::AppendErrorWithFormat(), lldb_private::CommandReturnObject::AppendMessage(), lldb_private::CommandReturnObject::AppendMessageWithFormat(), lldb::eReturnStatusFailed, lldb::eReturnStatusSuccessContinuingNoResult, lldb::eReturnStatusSuccessContinuingResult, lldb::eReturnStatusSuccessFinishResult, lldb::eStopReasonException, lldb::eStopReasonInstrumentation, lldb::eStopReasonSignal, 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::GetOutputData(), lldb_private::CommandInterpreterRunOptions::GetPrintResults(), lldb_private::Debugger::GetPrompt(), lldb_private::TargetList::GetSelectedTarget(), 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::GetTargetList(), HandleCommand(), lldb_private::CommandInterpreterRunOptions::m_add_to_history, lldb_private::Debugger::SetAsyncExecution(), lldb_private::CommandReturnObject::SetStatus(), lldb_private::CommandReturnObject::Succeeded(), UpdateExecutionContext(), and WasInterrupted().

Referenced by lldb_private::BreakpointOptions::BreakpointOptionsCallbackFunction(), lldb_private::Target::RunStopHooks(), and CommandObjectWatchpointCommandAdd::WatchpointOptionsCallbackFunction().

◆ HandleCommandsFromFile()

void CommandInterpreter::HandleCommandsFromFile ( FileSpec file,
ExecutionContext context,
CommandInterpreterRunOptions options,
CommandReturnObject result 
)

Execute a list of commands from a file.

Parameters
[in]fileThe file from which to read in commands.
[in,out]contextThe execution context in which to run the commands. Can be nullptr in which case the default context will be used.
[in]optionsThis object holds the options used to control when to stop, whether to execute commands, etc.
[out]resultThis 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 2370 of file CommandInterpreter.cpp.

References lldb_private::CommandReturnObject::AppendErrorWithFormat(), lldb_private::Status::AsCString(), lldb_private::ConstString::AsCString(), lldb_private::IOHandler::CommandInterpreter, eHandleCommandFlagEchoCommand, eHandleCommandFlagEchoCommentCommand, eHandleCommandFlagPrintResult, eHandleCommandFlagStopOnContinue, eHandleCommandFlagStopOnCrash, eHandleCommandFlagStopOnError, lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolYes, lldb_private::File::eOpenOptionRead, lldb::eReturnStatusFailed, lldb::eReturnStatusSuccessFinishNoResult, lldb_private::Status::Fail(), 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(), lldb_private::CommandInterpreterRunOptions::m_echo_commands, lldb_private::CommandInterpreterRunOptions::m_echo_comment_commands, 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::Debugger::RunIOHandler(), lldb_private::Debugger::SetAsyncExecution(), and lldb_private::CommandReturnObject::SetStatus().

Referenced by lldb::SBCommandInterpreter::HandleCommandsFromFile(), and SourceInitFile().

◆ HandleCompletion()

int CommandInterpreter::HandleCompletion ( const char *  current_line,
const char *  cursor,
const char *  last_char,
int  match_start_point,
int  max_return_elements,
StringList matches,
StringList descriptions 
)

◆ HandleCompletionMatches()

int CommandInterpreter::HandleCompletionMatches ( CompletionRequest request)

◆ HasAliases()

bool CommandInterpreter::HasAliases ( ) const

◆ HasAliasOptions()

bool CommandInterpreter::HasAliasOptions ( ) const

Definition at line 1943 of file CommandInterpreter.cpp.

References HasAliases().

Referenced by lldb::SBCommandInterpreter::HasAliasOptions().

◆ HasCommands()

bool CommandInterpreter::HasCommands ( ) const

◆ HasUserCommands()

bool CommandInterpreter::HasUserCommands ( ) const

Definition at line 1941 of file CommandInterpreter.cpp.

Referenced by GetCommandSP().

◆ Initialize()

void CommandInterpreter::Initialize ( )

◆ IOHandlerGetControlSequence()

ConstString lldb_private::CommandInterpreter::IOHandlerGetControlSequence ( char  ch)
inlineoverrideprotectedvirtual

Reimplemented from lldb_private::IOHandlerDelegate.

Definition at line 503 of file CommandInterpreter.h.

◆ IOHandlerInputComplete()

void CommandInterpreter::IOHandlerInputComplete ( IOHandler io_handler,
std::string &  data 
)
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 2764 of file CommandInterpreter.cpp.

References eHandleCommandFlagPrintResult, eHandleCommandFlagStopOnContinue, eHandleCommandFlagStopOnCrash, eHandleCommandFlagStopOnError, lldb_private::eLazyBoolCalculate, lldb::eReturnStatusFailed, lldb::eReturnStatusInvalid, lldb::eReturnStatusQuit, lldb::eReturnStatusStarted, lldb::eReturnStatusSuccessContinuingNoResult, lldb::eReturnStatusSuccessContinuingResult, lldb::eReturnStatusSuccessFinishNoResult, lldb::eReturnStatusSuccessFinishResult, lldb::eStopReasonException, lldb::eStopReasonInstrumentation, lldb::eStopReasonSignal, lldb_private::CommandReturnObject::GetAbnormalStopWasExpected(), lldb_private::CommandReturnObject::GetDidChangeProcessState(), lldb_private::CommandReturnObject::GetErrorData(), lldb_private::IOHandler::GetErrorStreamFile(), lldb_private::IOHandler::GetFlags(), lldb_private::CommandReturnObject::GetImmediateErrorStream(), lldb_private::CommandReturnObject::GetImmediateOutputStream(), lldb_private::IOHandler::GetIsInteractive(), lldb_private::CommandReturnObject::GetOutputData(), lldb_private::IOHandler::GetOutputStreamFile(), GetProcessOutput(), lldb_private::IOHandler::GetPrompt(), lldb_private::TargetList::GetSelectedTarget(), lldb_private::CommandReturnObject::GetStatus(), lldb_private::Debugger::GetTargetList(), HandleCommand(), lldb_private::IOHandler::SetIsDone(), lldb_private::Flags::Test(), and WasInterrupted().

◆ IOHandlerInterrupt()

bool CommandInterpreter::IOHandlerInterrupt ( IOHandler io_handler)
overrideprotectedvirtual

◆ IsActive()

bool CommandInterpreter::IsActive ( )

◆ LoadCommandDictionary()

void CommandInterpreter::LoadCommandDictionary ( )

◆ OutputFormattedHelpText() [1/2]

void CommandInterpreter::OutputFormattedHelpText ( Stream strm,
llvm::StringRef  prefix,
llvm::StringRef  help_text 
)

◆ OutputFormattedHelpText() [2/2]

void CommandInterpreter::OutputFormattedHelpText ( Stream stream,
llvm::StringRef  command_word,
llvm::StringRef  separator,
llvm::StringRef  help_text,
size_t  max_word_len 
)

◆ OutputHelpText()

void CommandInterpreter::OutputHelpText ( Stream stream,
llvm::StringRef  command_word,
llvm::StringRef  separator,
llvm::StringRef  help_text,
uint32_t  max_word_len 
)

◆ ProcessEmbeddedScriptCommands()

const char * CommandInterpreter::ProcessEmbeddedScriptCommands ( const char *  arg)

Definition at line 443 of file CommandInterpreter.cpp.

Referenced by lldb_private::CommandObjectParsed::Execute().

◆ RemoveAlias()

bool CommandInterpreter::RemoveAlias ( llvm::StringRef  alias_name)

Definition at line 1155 of file CommandInterpreter.cpp.

◆ RemoveAllUser()

void lldb_private::CommandInterpreter::RemoveAllUser ( )
inline

Definition at line 237 of file CommandInterpreter.h.

◆ RemoveCommand()

bool CommandInterpreter::RemoveCommand ( llvm::StringRef  cmd)

Definition at line 1164 of file CommandInterpreter.cpp.

◆ RemoveUser()

bool CommandInterpreter::RemoveUser ( llvm::StringRef  alias_name)

Definition at line 1175 of file CommandInterpreter.cpp.

◆ ResolveCommand()

void CommandInterpreter::ResolveCommand ( const char *  command_line,
CommandReturnObject result 
)

◆ RunCommandInterpreter()

void CommandInterpreter::RunCommandInterpreter ( bool  auto_handle_events,
bool  spawn_thread,
CommandInterpreterRunOptions options 
)

◆ SetBatchCommandMode()

bool lldb_private::CommandInterpreter::SetBatchCommandMode ( bool  value)
inline

Definition at line 407 of file CommandInterpreter.h.

Referenced by SourceInitFile().

◆ SetEchoCommands()

void CommandInterpreter::SetEchoCommands ( bool  b)

◆ SetEchoCommentCommands()

void CommandInterpreter::SetEchoCommentCommands ( bool  b)

◆ SetPromptOnQuit()

void CommandInterpreter::SetPromptOnQuit ( bool  b)

◆ SetQuitExitCode()

bool CommandInterpreter::SetQuitExitCode ( int  exit_code)

Sets the exit code for the quit command.

Parameters
[in]exit_codeThe exit code that the driver should return on exit.
Returns
True if the exit code was successfully set; false if the interpreter doesn't allow custom exit codes.
See also
AllowExitCodeOnQuit

Definition at line 189 of file CommandInterpreter.cpp.

Referenced by lldb_private::CommandObjectQuit::DoExecute().

◆ SetSynchronous()

void CommandInterpreter::SetSynchronous ( bool  value)
protected

Definition at line 2505 of file CommandInterpreter.cpp.

◆ SkipAppInitFiles()

void lldb_private::CommandInterpreter::SkipAppInitFiles ( bool  skip_app_init_files)
inline

Definition at line 393 of file CommandInterpreter.h.

Referenced by lldb::SBDebugger::Create().

◆ SkipLLDBInitFiles()

void lldb_private::CommandInterpreter::SkipLLDBInitFiles ( bool  skip_lldbinit_files)
inline

Definition at line 389 of file CommandInterpreter.h.

Referenced by lldb::SBDebugger::Create().

◆ SourceInitFile()

void CommandInterpreter::SourceInitFile ( bool  in_cwd,
CommandReturnObject result 
)

◆ TruncationWarningGiven()

void lldb_private::CommandInterpreter::TruncationWarningGiven ( )
inline

Definition at line 422 of file CommandInterpreter.h.

◆ TruncationWarningNecessary()

bool lldb_private::CommandInterpreter::TruncationWarningNecessary ( )
inline

Definition at line 418 of file CommandInterpreter.h.

◆ TruncationWarningText()

const char* lldb_private::CommandInterpreter::TruncationWarningText ( )
inline

Definition at line 424 of file CommandInterpreter.h.

◆ UpdateExecutionContext()

void CommandInterpreter::UpdateExecutionContext ( ExecutionContext override_context)

◆ UpdatePrompt()

void CommandInterpreter::UpdatePrompt ( llvm::StringRef  prompt)

◆ UserCommandExists()

bool CommandInterpreter::UserCommandExists ( llvm::StringRef  cmd) const

Definition at line 1132 of file CommandInterpreter.cpp.

Referenced by AddUserCommand().

◆ WasInterrupted()

bool CommandInterpreter::WasInterrupted ( ) const

Friends And Related Function Documentation

◆ Debugger

friend class Debugger
friend

Definition at line 497 of file CommandInterpreter.h.


The documentation for this class was generated from the following files: