LLDB  mainline
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | 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=default
 
ConstStringGetBroadcasterClass () const override
 This needs to be filled in if you are going to register the broadcaster with the broadcaster manager and do broadcaster class matching. More...
 
void SourceInitFileCwd (CommandReturnObject &result)
 
void SourceInitFileHome (CommandReturnObject &result, bool is_repl=false)
 
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=false) 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, const ExecutionContext &override_context, CommandReturnObject &result)
 
bool HandleCommand (const char *command_line, LazyBool add_to_history, CommandReturnObject &result)
 
bool WasInterrupted () const
 
void HandleCommands (const StringList &commands, const ExecutionContext &context, const CommandInterpreterRunOptions &options, CommandReturnObject &result)
 Execute a list of commands in sequence. More...
 
void HandleCommands (const StringList &commands, const CommandInterpreterRunOptions &options, CommandReturnObject &result)
 
void HandleCommandsFromFile (FileSpec &file, const ExecutionContext &context, const CommandInterpreterRunOptions &options, CommandReturnObject &result)
 Execute a list of commands from a file. More...
 
void HandleCommandsFromFile (FileSpec &file, const CommandInterpreterRunOptions &options, CommandReturnObject &result)
 
CommandObjectGetCommandObjectForCommand (llvm::StringRef &command_line)
 
llvm::Optional< std::stringGetAutoSuggestionForCommand (llvm::StringRef line)
 Returns the auto-suggestion string that should be added to the given command line. More...
 
void HandleCompletion (CompletionRequest &request)
 
void HandleCompletionMatches (CompletionRequest &request)
 
int GetCommandNamesMatchingPartialString (const char *cmd_cstr, bool include_aliases, StringList &matches, StringList &descriptions)
 
void GetHelp (CommandReturnObject &result, uint32_t types=eCommandTypesAllThem)
 
void GetAliasHelp (const char *alias_name, StreamString &help_string)
 
void OutputFormattedHelpText (Stream &strm, llvm::StringRef prefix, llvm::StringRef help_text)
 
void OutputFormattedHelpText (Stream &stream, llvm::StringRef command_word, llvm::StringRef separator, llvm::StringRef help_text, size_t max_word_len)
 
void OutputHelpText (Stream &stream, llvm::StringRef command_word, llvm::StringRef separator, llvm::StringRef help_text, uint32_t max_word_len)
 
DebuggerGetDebugger ()
 
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 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 ()
 
CommandHistoryGetCommandHistory ()
 
bool IsActive ()
 
CommandInterpreterRunResult RunCommandInterpreter (CommandInterpreterRunOptions &options)
 
void GetLLDBCommandsFromIOHandler (const char *prompt, IOHandlerDelegate &delegate, void *baton=nullptr)
 
void GetPythonCommandsFromIOHandler (const char *prompt, IOHandlerDelegate &delegate, void *baton=nullptr)
 
const char * GetCommandPrefix ()
 
bool GetExpandRegexAliases () const
 
bool GetPromptOnQuit () const
 
void SetPromptOnQuit (bool enable)
 
bool GetSaveSessionOnQuit () const
 
void SetSaveSessionOnQuit (bool enable)
 
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
 
const CommandObject::CommandMapGetUserCommands () const
 
const CommandObject::CommandMapGetCommands () const
 
const CommandObject::CommandMapGetAliases () const
 
void AllowExitCodeOnQuit (bool allow)
 Specify if the command interpreter should allow that the user can specify a custom exit code when calling 'quit'. More...
 
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
 
lldb::IOHandlerSP GetIOHandler (bool force_create=false, CommandInterpreterRunOptions *options=nullptr)
 
bool GetSpaceReplPrompts () const
 
bool SaveTranscript (CommandReturnObject &result, llvm::Optional< std::string > output_file=llvm::None)
 Save the current debugger session transcript to a file on disk. More...
 
FileSpec GetCurrentSourceDir ()
 
- 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 ()=default
 
 Properties (const lldb::OptionValuePropertiesSP &collection_sp)
 
virtual ~Properties ()=default
 
virtual lldb::OptionValuePropertiesSP GetValueProperties () const
 
virtual lldb::OptionValueSP GetPropertyValue (const ExecutionContext *exe_ctx, llvm::StringRef property_path, bool will_modify, Status &error) const
 
virtual Status SetPropertyValue (const ExecutionContext *exe_ctx, VarSetOperationType op, llvm::StringRef property_path, llvm::StringRef value)
 
virtual Status DumpPropertyValue (const ExecutionContext *exe_ctx, Stream &strm, llvm::StringRef property_path, uint32_t dump_mask)
 
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 llvm::Optional< std::stringIOHandlerSuggestion (IOHandler &io_handler, llvm::StringRef line)
 
virtual void IOHandlerComplete (IOHandler &io_handler, CompletionRequest &request)
 
virtual const char * IOHandlerGetFixIndentationCharacters ()
 
virtual int IOHandlerFixIndentation (IOHandler &io_handler, const StringList &lines, int cursor_position)
 Called when a new line is created or one of an identified set of indentation characters is typed. More...
 
virtual void IOHandlerInputInterrupted (IOHandler &io_handler, std::string &data)
 
virtual bool IOHandlerIsInputComplete (IOHandler &io_handler, StringList &lines)
 Called to determine whether typing enter after the last line in lines should end input. More...
 
virtual const char * IOHandlerGetCommandPrefix ()
 
virtual const char * IOHandlerGetHelpPrologue ()
 

Static Public Member Functions

static 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
 
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  CommandHandlingState { CommandHandlingState::eIdle, CommandHandlingState::eInProgress, CommandHandlingState::eInterrupted }
 

Private Member Functions

void OverrideExecutionContext (const ExecutionContext &override_context)
 
void RestoreExecutionContext ()
 
Status PreprocessCommand (std::string &command)
 
void SourceInitFile (FileSpec file, CommandReturnObject &result)
 
CommandObjectResolveCommandImpl (std::string &command_line, CommandReturnObject &result)
 
void FindCommandsForApropos (llvm::StringRef word, StringList &commands_found, StringList &commands_help, CommandObject::CommandMap &command_map)
 
void PrintCommandOutput (Stream &stream, llvm::StringRef str)
 
bool EchoCommandNonInteractive (llvm::StringRef line, const Flags &io_handler_flags) const
 
void StartHandlingCommand ()
 
void FinishHandlingCommand ()
 
bool InterruptCommand ()
 

Private Attributes

std::atomic< CommandHandlingStatem_command_state
 
int m_iohandler_nesting_level = 0
 
Debuggerm_debugger
 
std::stack< ExecutionContextm_overriden_exe_contexts
 
bool m_synchronous_execution
 
bool m_skip_lldbinit_files
 
bool m_skip_app_init_files
 
CommandObject::CommandMap m_command_dict
 
CommandObject::CommandMap m_alias_dict
 
CommandObject::CommandMap m_user_dict
 
CommandHistory m_command_history
 
std::string m_repeat_command
 
lldb::IOHandlerSP m_command_io_handler_sp
 
char m_comment_char
 
bool m_batch_command_mode
 
ChildrenTruncatedWarningStatus m_truncation_warning
 
uint32_t m_command_source_depth
 
std::vector< FileSpecm_command_source_dirs
 A stack of directory paths. More...
 
std::vector< uint32_tm_command_source_flags
 
CommandInterpreterRunResult m_result
 
llvm::Optional< int > m_quit_exit_code
 
bool m_allow_exit_code = false
 
StreamString m_transcript_stream
 

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 214 of file CommandInterpreter.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
eBroadcastBitThreadShouldExit 
eBroadcastBitResetPrompt 
eBroadcastBitQuitCommandReceived 
eBroadcastBitAsynchronousOutputData 
eBroadcastBitAsynchronousErrorData 

Definition at line 218 of file CommandInterpreter.h.

◆ ChildrenTruncatedWarningStatus

Enumerator
eNoTruncation 
eUnwarnedTruncation 
eWarnedTruncation 

Definition at line 226 of file CommandInterpreter.h.

◆ CommandHandlingState

Enumerator
eIdle 
eInProgress 
eInterrupted 

Definition at line 610 of file CommandInterpreter.h.

◆ CommandTypes

Enumerator
eCommandTypesBuiltin 
eCommandTypesUserDef 
eCommandTypesAliases 
eCommandTypesHidden 
eCommandTypesAllThem 

Definition at line 233 of file CommandInterpreter.h.

Constructor & Destructor Documentation

◆ CommandInterpreter()

CommandInterpreter::CommandInterpreter ( Debugger debugger,
bool  synchronous_execution 
)

◆ ~CommandInterpreter()

lldb_private::CommandInterpreter::~CommandInterpreter ( )
overridedefault

Member Function Documentation

◆ AddAlias()

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

Referenced by Initialize().

◆ AddCommand()

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

◆ AddUserCommand()

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

◆ AliasExists()

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

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

References m_allow_exit_code, and m_quit_exit_code.

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

◆ BuildAliasCommandArgs()

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

◆ BuildAliasResult()

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

◆ ChildrenTruncated()

void lldb_private::CommandInterpreter::ChildrenTruncated ( )
inline

Definition at line 450 of file CommandInterpreter.h.

References eNoTruncation, eUnwarnedTruncation, and m_truncation_warning.

◆ Clear()

void CommandInterpreter::Clear ( )

Definition at line 480 of file CommandInterpreter.cpp.

References m_command_io_handler_sp.

◆ CommandExists()

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

◆ Confirm()

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

◆ DidProcessStopAbnormally()

bool lldb_private::CommandInterpreter::DidProcessStopAbnormally ( ) const
protected

◆ EchoCommandNonInteractive()

bool lldb_private::CommandInterpreter::EchoCommandNonInteractive ( llvm::StringRef  line,
const Flags io_handler_flags 
) const
private

◆ FindCommandsForApropos() [1/2]

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

◆ FindCommandsForApropos() [2/2]

void lldb_private::CommandInterpreter::FindCommandsForApropos ( llvm::StringRef  word,
StringList commands_found,
StringList commands_help,
CommandObject::CommandMap command_map 
)
private

◆ FinishHandlingCommand()

void lldb_private::CommandInterpreter::FinishHandlingCommand ( )
private

◆ GetAlias()

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

◆ GetAliases()

const CommandObject::CommandMap& lldb_private::CommandInterpreter::GetAliases ( ) const
inline

Definition at line 513 of file CommandInterpreter.h.

References m_alias_dict.

◆ GetAliasFullName()

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

◆ GetAliasHelp()

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

◆ GetAutoSuggestionForCommand()

llvm::Optional<std::string> lldb_private::CommandInterpreter::GetAutoSuggestionForCommand ( llvm::StringRef  line)

Returns the auto-suggestion string that should be added to the given command line.

Referenced by lldb_private::IOHandlerDelegate::IOHandlerSuggestion().

◆ GetBatchCommandMode()

bool lldb_private::CommandInterpreter::GetBatchCommandMode ( )
inline

Definition at line 442 of file CommandInterpreter.h.

References m_batch_command_mode.

◆ GetBroadcasterClass()

ConstString& lldb_private::CommandInterpreter::GetBroadcasterClass ( ) const
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 249 of file CommandInterpreter.h.

References GetStaticBroadcasterClass().

◆ GetCommandHistory()

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

Definition at line 468 of file CommandInterpreter.h.

References m_command_history.

◆ GetCommandNamesMatchingPartialString()

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

◆ GetCommandObject()

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

◆ GetCommandObjectForCommand()

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

◆ GetCommandPrefix()

const char* lldb_private::CommandInterpreter::GetCommandPrefix ( )

◆ GetCommands()

const CommandObject::CommandMap& lldb_private::CommandInterpreter::GetCommands ( ) const
inline

Definition at line 509 of file CommandInterpreter.h.

References m_command_dict.

◆ GetCommandSP()

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

◆ GetCommandSPExact()

lldb::CommandObjectSP lldb_private::CommandInterpreter::GetCommandSPExact ( llvm::StringRef  cmd,
bool  include_aliases = false 
) const

Referenced by Initialize().

◆ GetCurrentSourceDir()

FileSpec lldb_private::CommandInterpreter::GetCurrentSourceDir ( )

◆ GetDebugger()

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

◆ GetEchoCommands()

bool CommandInterpreter::GetEchoCommands ( ) const

Definition at line 173 of file CommandInterpreter.cpp.

References lldb_private::Properties::m_collection_sp.

◆ GetEchoCommentCommands()

bool CommandInterpreter::GetEchoCommentCommands ( ) const

Definition at line 184 of file CommandInterpreter.cpp.

References lldb_private::Properties::m_collection_sp.

◆ GetExecutionContext()

ExecutionContext lldb_private::CommandInterpreter::GetExecutionContext ( ) const

◆ GetExpandRegexAliases()

bool CommandInterpreter::GetExpandRegexAliases ( ) const

◆ GetHelp()

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

◆ GetIOHandler()

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

◆ GetLLDBCommandsFromIOHandler()

void lldb_private::CommandInterpreter::GetLLDBCommandsFromIOHandler ( const char *  prompt,
IOHandlerDelegate delegate,
void *  baton = nullptr 
)

◆ GetOptionArgumentPosition()

int lldb_private::CommandInterpreter::GetOptionArgumentPosition ( const char *  in_string)

◆ GetPlatform()

lldb::PlatformSP lldb_private::CommandInterpreter::GetPlatform ( bool  prefer_target_platform)

◆ GetProcessOutput()

void lldb_private::CommandInterpreter::GetProcessOutput ( )
protected

◆ GetPromptOnQuit()

bool CommandInterpreter::GetPromptOnQuit ( ) const

◆ GetPythonCommandsFromIOHandler()

void lldb_private::CommandInterpreter::GetPythonCommandsFromIOHandler ( const char *  prompt,
IOHandlerDelegate delegate,
void *  baton = nullptr 
)

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

References m_quit_exit_code.

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

◆ GetRepeatPreviousCommand()

bool CommandInterpreter::GetRepeatPreviousCommand ( ) const

Definition at line 236 of file CommandInterpreter.cpp.

References lldb_private::Properties::m_collection_sp.

◆ GetSaveSessionDirectory()

FileSpec CommandInterpreter::GetSaveSessionDirectory ( ) const

Definition at line 163 of file CommandInterpreter.cpp.

References lldb_private::Properties::m_collection_sp.

◆ GetSaveSessionOnQuit()

bool CommandInterpreter::GetSaveSessionOnQuit ( ) const

◆ GetSpaceReplPrompts()

bool CommandInterpreter::GetSpaceReplPrompts ( ) const

◆ GetStaticBroadcasterClass()

ConstString & CommandInterpreter::GetStaticBroadcasterClass ( )
static

Definition at line 111 of file CommandInterpreter.cpp.

Referenced by GetBroadcasterClass().

◆ GetStopCmdSourceOnError()

bool CommandInterpreter::GetStopCmdSourceOnError ( ) const

Definition at line 224 of file CommandInterpreter.cpp.

References lldb_private::Properties::m_collection_sp.

◆ GetSynchronous()

bool lldb_private::CommandInterpreter::GetSynchronous ( )

◆ GetUserCommands()

const CommandObject::CommandMap& lldb_private::CommandInterpreter::GetUserCommands ( ) const
inline

Definition at line 505 of file CommandInterpreter.h.

References m_user_dict.

◆ HandleCommand() [1/2]

bool lldb_private::CommandInterpreter::HandleCommand ( const char *  command_line,
LazyBool  add_to_history,
CommandReturnObject result 
)

◆ HandleCommand() [2/2]

bool lldb_private::CommandInterpreter::HandleCommand ( const char *  command_line,
LazyBool  add_to_history,
const ExecutionContext override_context,
CommandReturnObject result 
)

◆ HandleCommands() [1/2]

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

◆ HandleCommands() [2/2]

void lldb_private::CommandInterpreter::HandleCommands ( const StringList commands,
const ExecutionContext context,
const 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.
[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.

Referenced by lldb_private::BreakpointOptions::BreakpointOptionsCallbackFunction(), and lldb_private::Target::StopHookCommandLine::HandleStop().

◆ HandleCommandsFromFile() [1/2]

void lldb_private::CommandInterpreter::HandleCommandsFromFile ( FileSpec file,
const CommandInterpreterRunOptions options,
CommandReturnObject result 
)

◆ HandleCommandsFromFile() [2/2]

void lldb_private::CommandInterpreter::HandleCommandsFromFile ( FileSpec file,
const ExecutionContext context,
const 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.
[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.

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

◆ HandleCompletion()

void lldb_private::CommandInterpreter::HandleCompletion ( CompletionRequest request)

◆ HandleCompletionMatches()

void lldb_private::CommandInterpreter::HandleCompletionMatches ( CompletionRequest request)

◆ HasAliases()

bool lldb_private::CommandInterpreter::HasAliases ( ) const

◆ HasAliasOptions()

bool lldb_private::CommandInterpreter::HasAliasOptions ( ) const

◆ HasCommands()

bool lldb_private::CommandInterpreter::HasCommands ( ) const

◆ HasUserCommands()

bool lldb_private::CommandInterpreter::HasUserCommands ( ) const

◆ Initialize()

void CommandInterpreter::Initialize ( )

◆ InterruptCommand()

bool lldb_private::CommandInterpreter::InterruptCommand ( )
private

◆ IOHandlerGetControlSequence()

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

Reimplemented from lldb_private::IOHandlerDelegate.

Definition at line 564 of file CommandInterpreter.h.

◆ IOHandlerInputComplete()

void lldb_private::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.

◆ IOHandlerInterrupt()

bool lldb_private::CommandInterpreter::IOHandlerInterrupt ( IOHandler io_handler)
overrideprotectedvirtual

Reimplemented from lldb_private::IOHandlerDelegate.

◆ IsActive()

bool lldb_private::CommandInterpreter::IsActive ( )

◆ LoadCommandDictionary()

void CommandInterpreter::LoadCommandDictionary ( )

◆ OutputFormattedHelpText() [1/2]

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

◆ OutputFormattedHelpText() [2/2]

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

◆ OutputHelpText()

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

◆ OverrideExecutionContext()

void lldb_private::CommandInterpreter::OverrideExecutionContext ( const ExecutionContext override_context)
private

◆ PreprocessCommand()

Status lldb_private::CommandInterpreter::PreprocessCommand ( std::string command)
private

◆ PrintCommandOutput()

void lldb_private::CommandInterpreter::PrintCommandOutput ( Stream stream,
llvm::StringRef  str 
)
private

◆ ProcessEmbeddedScriptCommands()

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

Definition at line 484 of file CommandInterpreter.cpp.

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

◆ RemoveAlias()

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

◆ RemoveAllUser()

void lldb_private::CommandInterpreter::RemoveAllUser ( )
inline

Definition at line 288 of file CommandInterpreter.h.

References m_user_dict.

◆ RemoveCommand()

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

◆ RemoveUser()

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

◆ ResolveCommand()

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

◆ ResolveCommandImpl()

CommandObject* lldb_private::CommandInterpreter::ResolveCommandImpl ( std::string command_line,
CommandReturnObject result 
)
private

Referenced by ResolveCommand().

◆ RestoreExecutionContext()

void lldb_private::CommandInterpreter::RestoreExecutionContext ( )
private

◆ RunCommandInterpreter()

CommandInterpreterRunResult lldb_private::CommandInterpreter::RunCommandInterpreter ( CommandInterpreterRunOptions options)

◆ SaveTranscript()

bool lldb_private::CommandInterpreter::SaveTranscript ( CommandReturnObject result,
llvm::Optional< std::string output_file = llvm::None 
)

Save the current debugger session transcript to a file on disk.

Parameters
output_fileThe 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.
resultThis is used to pass function output and error messages.
Returns
true if the session transcript was successfully written to disk, false otherwise.

Referenced by lldb_private::Debugger::Destroy().

◆ SetBatchCommandMode()

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

Definition at line 444 of file CommandInterpreter.h.

References m_batch_command_mode.

◆ SetEchoCommands()

void CommandInterpreter::SetEchoCommands ( bool  enable)

Definition at line 179 of file CommandInterpreter.cpp.

References lldb_private::Properties::m_collection_sp.

◆ SetEchoCommentCommands()

void CommandInterpreter::SetEchoCommentCommands ( bool  enable)

Definition at line 190 of file CommandInterpreter.cpp.

References lldb_private::Properties::m_collection_sp.

◆ SetPromptOnQuit()

void CommandInterpreter::SetPromptOnQuit ( bool  enable)

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

References m_allow_exit_code, and m_quit_exit_code.

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

◆ SetSaveSessionDirectory()

void CommandInterpreter::SetSaveSessionDirectory ( llvm::StringRef  path)

Definition at line 168 of file CommandInterpreter.cpp.

References lldb_private::Properties::m_collection_sp.

◆ SetSaveSessionOnQuit()

void CommandInterpreter::SetSaveSessionOnQuit ( bool  enable)

Definition at line 158 of file CommandInterpreter.cpp.

References lldb_private::Properties::m_collection_sp.

◆ SetSynchronous()

void lldb_private::CommandInterpreter::SetSynchronous ( bool  value)
protected

Referenced by CommandInterpreter().

◆ SkipAppInitFiles()

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

Definition at line 430 of file CommandInterpreter.h.

References m_skip_app_init_files.

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

◆ SkipLLDBInitFiles()

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

Definition at line 426 of file CommandInterpreter.h.

References m_skip_lldbinit_files.

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

◆ SourceInitFile()

void lldb_private::CommandInterpreter::SourceInitFile ( FileSpec  file,
CommandReturnObject result 
)
private

◆ SourceInitFileCwd()

void lldb_private::CommandInterpreter::SourceInitFileCwd ( CommandReturnObject result)

◆ SourceInitFileHome()

void lldb_private::CommandInterpreter::SourceInitFileHome ( CommandReturnObject result,
bool  is_repl = false 
)

◆ StartHandlingCommand()

void lldb_private::CommandInterpreter::StartHandlingCommand ( )
private

◆ TruncationWarningGiven()

void lldb_private::CommandInterpreter::TruncationWarningGiven ( )
inline

Definition at line 459 of file CommandInterpreter.h.

References eWarnedTruncation, and m_truncation_warning.

◆ TruncationWarningNecessary()

bool lldb_private::CommandInterpreter::TruncationWarningNecessary ( )
inline

Definition at line 455 of file CommandInterpreter.h.

References eUnwarnedTruncation, and m_truncation_warning.

◆ TruncationWarningText()

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

Definition at line 461 of file CommandInterpreter.h.

◆ UpdatePrompt()

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

◆ UserCommandExists()

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

◆ WasInterrupted()

bool lldb_private::CommandInterpreter::WasInterrupted ( ) const

Friends And Related Function Documentation

◆ Debugger

friend class Debugger
friend

Definition at line 558 of file CommandInterpreter.h.

Member Data Documentation

◆ m_alias_dict

CommandObject::CommandMap lldb_private::CommandInterpreter::m_alias_dict
private

Definition at line 637 of file CommandInterpreter.h.

Referenced by GetAliases().

◆ m_allow_exit_code

bool lldb_private::CommandInterpreter::m_allow_exit_code = false
private

Definition at line 662 of file CommandInterpreter.h.

Referenced by AllowExitCodeOnQuit(), and SetQuitExitCode().

◆ m_batch_command_mode

bool lldb_private::CommandInterpreter::m_batch_command_mode
private

Definition at line 644 of file CommandInterpreter.h.

Referenced by GetBatchCommandMode(), and SetBatchCommandMode().

◆ m_command_dict

CommandObject::CommandMap lldb_private::CommandInterpreter::m_command_dict
private

Definition at line 633 of file CommandInterpreter.h.

Referenced by GetCommands(), and LoadCommandDictionary().

◆ m_command_history

CommandHistory lldb_private::CommandInterpreter::m_command_history
private

Definition at line 639 of file CommandInterpreter.h.

Referenced by GetCommandHistory().

◆ m_command_io_handler_sp

lldb::IOHandlerSP lldb_private::CommandInterpreter::m_command_io_handler_sp
private

Definition at line 642 of file CommandInterpreter.h.

Referenced by Clear().

◆ m_command_source_depth

uint32_t lldb_private::CommandInterpreter::m_command_source_depth
private

Definition at line 651 of file CommandInterpreter.h.

◆ m_command_source_dirs

std::vector<FileSpec> lldb_private::CommandInterpreter::m_command_source_dirs
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 654 of file CommandInterpreter.h.

◆ m_command_source_flags

std::vector<uint32_t> lldb_private::CommandInterpreter::m_command_source_flags
private

Definition at line 655 of file CommandInterpreter.h.

◆ m_command_state

std::atomic<CommandHandlingState> lldb_private::CommandInterpreter::m_command_state
private
Initial value:

Definition at line 616 of file CommandInterpreter.h.

◆ m_comment_char

char lldb_private::CommandInterpreter::m_comment_char
private

Definition at line 643 of file CommandInterpreter.h.

◆ m_debugger

Debugger& lldb_private::CommandInterpreter::m_debugger
private

Definition at line 625 of file CommandInterpreter.h.

Referenced by GetDebugger(), and Initialize().

◆ m_iohandler_nesting_level

int lldb_private::CommandInterpreter::m_iohandler_nesting_level = 0
private

Definition at line 619 of file CommandInterpreter.h.

◆ m_overriden_exe_contexts

std::stack<ExecutionContext> lldb_private::CommandInterpreter::m_overriden_exe_contexts
private

Definition at line 629 of file CommandInterpreter.h.

◆ m_quit_exit_code

llvm::Optional<int> lldb_private::CommandInterpreter::m_quit_exit_code
private

Definition at line 660 of file CommandInterpreter.h.

Referenced by AllowExitCodeOnQuit(), GetQuitExitCode(), and SetQuitExitCode().

◆ m_repeat_command

std::string lldb_private::CommandInterpreter::m_repeat_command
private

Definition at line 640 of file CommandInterpreter.h.

◆ m_result

CommandInterpreterRunResult lldb_private::CommandInterpreter::m_result
private

Definition at line 656 of file CommandInterpreter.h.

◆ m_skip_app_init_files

bool lldb_private::CommandInterpreter::m_skip_app_init_files
private

Definition at line 632 of file CommandInterpreter.h.

Referenced by SkipAppInitFiles().

◆ m_skip_lldbinit_files

bool lldb_private::CommandInterpreter::m_skip_lldbinit_files
private

Definition at line 631 of file CommandInterpreter.h.

Referenced by SkipLLDBInitFiles().

◆ m_synchronous_execution

bool lldb_private::CommandInterpreter::m_synchronous_execution
private

Definition at line 630 of file CommandInterpreter.h.

◆ m_transcript_stream

StreamString lldb_private::CommandInterpreter::m_transcript_stream
private

Definition at line 664 of file CommandInterpreter.h.

◆ m_truncation_warning

ChildrenTruncatedWarningStatus lldb_private::CommandInterpreter::m_truncation_warning
private

◆ m_user_dict

CommandObject::CommandMap lldb_private::CommandInterpreter::m_user_dict
private

Definition at line 638 of file CommandInterpreter.h.

Referenced by GetUserCommands(), and RemoveAllUser().


The documentation for this class was generated from the following files:
lldb_private::CommandInterpreter::CommandHandlingState::eIdle
@ eIdle