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

#include <SBCommandInterpreter.h>

Public Types

enum  {
  eBroadcastBitThreadShouldExit = (1 << 0), eBroadcastBitResetPrompt = (1 << 1), eBroadcastBitQuitCommandReceived = (1 << 2), eBroadcastBitAsynchronousOutputData = (1 << 3),
  eBroadcastBitAsynchronousErrorData = (1 << 4)
}
 

Public Member Functions

 SBCommandInterpreter (const lldb::SBCommandInterpreter &rhs)
 
 ~SBCommandInterpreter ()
 
const lldb::SBCommandInterpreteroperator= (const lldb::SBCommandInterpreter &rhs)
 
 operator bool () const
 
bool IsValid () const
 
bool CommandExists (const char *cmd)
 
bool AliasExists (const char *cmd)
 
lldb::SBBroadcaster GetBroadcaster ()
 
bool HasCommands ()
 
bool HasAliases ()
 
bool HasAliasOptions ()
 
lldb::SBProcess GetProcess ()
 
lldb::SBDebugger GetDebugger ()
 
lldb::SBCommand AddMultiwordCommand (const char *name, const char *help)
 
lldb::SBCommand AddCommand (const char *name, lldb::SBCommandPluginInterface *impl, const char *help)
 
lldb::SBCommand AddCommand (const char *name, lldb::SBCommandPluginInterface *impl, const char *help, const char *syntax)
 
void SourceInitFileInHomeDirectory (lldb::SBCommandReturnObject &result)
 
void SourceInitFileInCurrentWorkingDirectory (lldb::SBCommandReturnObject &result)
 
lldb::ReturnStatus HandleCommand (const char *command_line, lldb::SBCommandReturnObject &result, bool add_to_history=false)
 
lldb::ReturnStatus HandleCommand (const char *command_line, SBExecutionContext &exe_ctx, SBCommandReturnObject &result, bool add_to_history=false)
 
void HandleCommandsFromFile (lldb::SBFileSpec &file, lldb::SBExecutionContext &override_context, lldb::SBCommandInterpreterRunOptions &options, lldb::SBCommandReturnObject result)
 
int HandleCompletion (const char *current_line, const char *cursor, const char *last_char, int match_start_point, int max_return_elements, lldb::SBStringList &matches)
 
int HandleCompletion (const char *current_line, uint32_t cursor_pos, int match_start_point, int max_return_elements, lldb::SBStringList &matches)
 
int HandleCompletionWithDescriptions (const char *current_line, const char *cursor, const char *last_char, int match_start_point, int max_return_elements, lldb::SBStringList &matches, lldb::SBStringList &descriptions)
 
int HandleCompletionWithDescriptions (const char *current_line, uint32_t cursor_pos, int match_start_point, int max_return_elements, lldb::SBStringList &matches, lldb::SBStringList &descriptions)
 
bool WasInterrupted () const
 
bool SetCommandOverrideCallback (const char *command_name, lldb::CommandOverrideCallback callback, void *baton)
 
 SBCommandInterpreter (lldb_private::CommandInterpreter *interpreter_ptr=nullptr)
 
bool IsActive ()
 Return true if the command interpreter is the active IO handler. More...
 
const char * GetIOHandlerControlSequence (char ch)
 Get the string that needs to be written to the debugger stdin file handle when a control character is typed. More...
 
bool GetPromptOnQuit ()
 
void SetPromptOnQuit (bool b)
 
void AllowExitCodeOnQuit (bool allow)
 Sets whether the command interpreter should allow custom exit codes for the 'quit' command. More...
 
bool HasCustomQuitExitCode ()
 Returns true if the user has called the 'quit' command with a custom exit code. More...
 
int GetQuitStatus ()
 Returns the exit code that the user has specified when running the 'quit' command. More...
 
void ResolveCommand (const char *command_line, SBCommandReturnObject &result)
 Resolve the command just as HandleCommand would, expanding abbreviations and aliases. More...
 

Static Public Member Functions

static const char * GetArgumentTypeAsCString (const lldb::CommandArgumentType arg_type)
 
static const char * GetArgumentDescriptionAsCString (const lldb::CommandArgumentType arg_type)
 
static bool EventIsCommandInterpreterEvent (const lldb::SBEvent &event)
 
static const char * GetBroadcasterClass ()
 

Protected Member Functions

lldb_private::CommandInterpreterref ()
 
lldb_private::CommandInterpreterget ()
 
void reset (lldb_private::CommandInterpreter *)
 

Friends

class SBDebugger
 

Detailed Description

Definition at line 65 of file SBCommandInterpreter.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
eBroadcastBitThreadShouldExit 
eBroadcastBitResetPrompt 
eBroadcastBitQuitCommandReceived 
eBroadcastBitAsynchronousOutputData 
eBroadcastBitAsynchronousErrorData 

Definition at line 67 of file SBCommandInterpreter.h.

Constructor & Destructor Documentation

◆ SBCommandInterpreter() [1/2]

SBCommandInterpreter::SBCommandInterpreter ( const lldb::SBCommandInterpreter rhs)

◆ ~SBCommandInterpreter()

SBCommandInterpreter::~SBCommandInterpreter ( )
default

Referenced by SBCommandInterpreter().

◆ SBCommandInterpreter() [2/2]

SBCommandInterpreter::SBCommandInterpreter ( lldb_private::CommandInterpreter interpreter_ptr = nullptr)

Definition at line 176 of file SBCommandInterpreter.cpp.

References LLDB_RECORD_CONSTRUCTOR.

Member Function Documentation

◆ AddCommand() [1/2]

lldb::SBCommand SBCommandInterpreter::AddCommand ( const char *  name,
lldb::SBCommandPluginInterface impl,
const char *  help 
)

◆ AddCommand() [2/2]

lldb::SBCommand SBCommandInterpreter::AddCommand ( const char *  name,
lldb::SBCommandPluginInterface impl,
const char *  help,
const char *  syntax 
)

Definition at line 668 of file SBCommandInterpreter.cpp.

References AddCommand(), LLDB_RECORD_METHOD, and LLDB_RECORD_RESULT.

◆ AddMultiwordCommand()

lldb::SBCommand SBCommandInterpreter::AddMultiwordCommand ( const char *  name,
const char *  help 
)

◆ AliasExists()

bool SBCommandInterpreter::AliasExists ( const char *  cmd)

◆ AllowExitCodeOnQuit()

void SBCommandInterpreter::AllowExitCodeOnQuit ( bool  allow)

Sets whether the command interpreter should allow custom exit codes for the 'quit' command.

Definition at line 480 of file SBCommandInterpreter.cpp.

References lldb_private::CommandInterpreter::AllowExitCodeOnQuit(), and LLDB_RECORD_METHOD.

Referenced by lldb_private::repro::RegisterMethods< SBCommandInterpreterRunOptions >().

◆ CommandExists()

bool SBCommandInterpreter::CommandExists ( const char *  cmd)

◆ EventIsCommandInterpreterEvent()

bool SBCommandInterpreter::EventIsCommandInterpreterEvent ( const lldb::SBEvent event)
static

◆ get()

CommandInterpreter * SBCommandInterpreter::get ( )
protected

Definition at line 520 of file SBCommandInterpreter.cpp.

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

◆ GetArgumentDescriptionAsCString()

const char * SBCommandInterpreter::GetArgumentDescriptionAsCString ( const lldb::CommandArgumentType  arg_type)
static

◆ GetArgumentTypeAsCString()

const char * SBCommandInterpreter::GetArgumentTypeAsCString ( const lldb::CommandArgumentType  arg_type)
static

◆ GetBroadcaster()

SBBroadcaster SBCommandInterpreter::GetBroadcaster ( )

◆ GetBroadcasterClass()

const char * SBCommandInterpreter::GetBroadcasterClass ( )
static

◆ GetDebugger()

SBDebugger SBCommandInterpreter::GetDebugger ( )

◆ GetIOHandlerControlSequence()

const char * SBCommandInterpreter::GetIOHandlerControlSequence ( char  ch)

Get the string that needs to be written to the debugger stdin file handle when a control character is typed.

Some GUI programs will intercept "control + char" sequences and want to have them do what normally would happen when using a real terminal, so this function allows GUI programs to emulate this functionality.

Parameters
[in]chThe character that was typed along with the control key
Returns
The string that should be written into the file handle that is feeding the input stream for the debugger, or nullptr if there is no string for this control key.

Definition at line 240 of file SBCommandInterpreter.cpp.

References lldb_private::ConstString::GetCString(), lldb_private::CommandInterpreter::GetDebugger(), lldb_private::Debugger::GetTopIOHandlerControlSequence(), IsValid(), and LLDB_RECORD_METHOD.

Referenced by lldb_private::repro::RegisterMethods< SBCommandInterpreterRunOptions >().

◆ GetProcess()

SBProcess SBCommandInterpreter::GetProcess ( )

◆ GetPromptOnQuit()

bool SBCommandInterpreter::GetPromptOnQuit ( )

◆ GetQuitStatus()

int SBCommandInterpreter::GetQuitStatus ( )

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

Returns 0 if the user hasn't called 'quit' at all or without a custom exit code.

Definition at line 497 of file SBCommandInterpreter.cpp.

References lldb_private::CommandInterpreter::GetQuitExitCode(), and LLDB_RECORD_METHOD_NO_ARGS.

Referenced by lldb_private::repro::RegisterMethods< SBCommandInterpreterRunOptions >().

◆ HandleCommand() [1/2]

lldb::ReturnStatus SBCommandInterpreter::HandleCommand ( const char *  command_line,
lldb::SBCommandReturnObject result,
bool  add_to_history = false 
)

◆ HandleCommand() [2/2]

lldb::ReturnStatus SBCommandInterpreter::HandleCommand ( const char *  command_line,
SBExecutionContext exe_ctx,
SBCommandReturnObject result,
bool  add_to_history = false 
)

◆ HandleCommandsFromFile()

void SBCommandInterpreter::HandleCommandsFromFile ( lldb::SBFileSpec file,
lldb::SBExecutionContext override_context,
lldb::SBCommandInterpreterRunOptions options,
lldb::SBCommandReturnObject  result 
)

◆ HandleCompletion() [1/2]

int SBCommandInterpreter::HandleCompletion ( const char *  current_line,
const char *  cursor,
const char *  last_char,
int  match_start_point,
int  max_return_elements,
lldb::SBStringList matches 
)

◆ HandleCompletion() [2/2]

int SBCommandInterpreter::HandleCompletion ( const char *  current_line,
uint32_t  cursor_pos,
int  match_start_point,
int  max_return_elements,
lldb::SBStringList matches 
)

Definition at line 405 of file SBCommandInterpreter.cpp.

References HandleCompletion(), and LLDB_RECORD_METHOD.

◆ HandleCompletionWithDescriptions() [1/2]

int SBCommandInterpreter::HandleCompletionWithDescriptions ( const char *  current_line,
const char *  cursor,
const char *  last_char,
int  match_start_point,
int  max_return_elements,
lldb::SBStringList matches,
lldb::SBStringList descriptions 
)

◆ HandleCompletionWithDescriptions() [2/2]

int SBCommandInterpreter::HandleCompletionWithDescriptions ( const char *  current_line,
uint32_t  cursor_pos,
int  match_start_point,
int  max_return_elements,
lldb::SBStringList matches,
lldb::SBStringList descriptions 
)

◆ HasAliases()

bool SBCommandInterpreter::HasAliases ( )

◆ HasAliasOptions()

bool SBCommandInterpreter::HasAliasOptions ( )

◆ HasCommands()

bool SBCommandInterpreter::HasCommands ( )

◆ HasCustomQuitExitCode()

bool SBCommandInterpreter::HasCustomQuitExitCode ( )

Returns true if the user has called the 'quit' command with a custom exit code.

Definition at line 488 of file SBCommandInterpreter.cpp.

References lldb_private::CommandInterpreter::GetQuitExitCode(), and LLDB_RECORD_METHOD_NO_ARGS.

Referenced by lldb_private::repro::RegisterMethods< SBCommandInterpreterRunOptions >().

◆ IsActive()

bool SBCommandInterpreter::IsActive ( )

Return true if the command interpreter is the active IO handler.

This indicates that any input coming into the debugger handles will go to the command interpreter and will result in LLDB command line commands being executed.

Definition at line 228 of file SBCommandInterpreter.cpp.

References lldb_private::CommandInterpreter::IsActive(), IsValid(), and LLDB_RECORD_METHOD_NO_ARGS.

Referenced by lldb_private::repro::RegisterMethods< SBCommandInterpreterRunOptions >().

◆ IsValid()

bool SBCommandInterpreter::IsValid ( ) const

◆ operator bool()

SBCommandInterpreter::operator bool ( ) const
explicit

Definition at line 206 of file SBCommandInterpreter.cpp.

References LLDB_RECORD_METHOD_CONST_NO_ARGS.

◆ operator=()

const SBCommandInterpreter & SBCommandInterpreter::operator= ( const lldb::SBCommandInterpreter rhs)

Definition at line 192 of file SBCommandInterpreter.cpp.

References LLDB_RECORD_METHOD, and LLDB_RECORD_RESULT.

Referenced by SBCommandInterpreter().

◆ ref()

CommandInterpreter & SBCommandInterpreter::ref ( )
protected

Definition at line 522 of file SBCommandInterpreter.cpp.

◆ reset()

void SBCommandInterpreter::reset ( lldb_private::CommandInterpreter interpreter)
protected

Definition at line 527 of file SBCommandInterpreter.cpp.

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

◆ ResolveCommand()

void SBCommandInterpreter::ResolveCommand ( const char *  command_line,
SBCommandReturnObject result 
)

◆ SetCommandOverrideCallback()

bool SBCommandInterpreter::SetCommandOverrideCallback ( const char *  command_name,
lldb::CommandOverrideCallback  callback,
void *  baton 
)

◆ SetPromptOnQuit()

void SBCommandInterpreter::SetPromptOnQuit ( bool  b)

◆ SourceInitFileInCurrentWorkingDirectory()

void SBCommandInterpreter::SourceInitFileInCurrentWorkingDirectory ( lldb::SBCommandReturnObject result)

◆ SourceInitFileInHomeDirectory()

void SBCommandInterpreter::SourceInitFileInHomeDirectory ( lldb::SBCommandReturnObject result)

◆ WasInterrupted()

bool SBCommandInterpreter::WasInterrupted ( ) const

Friends And Related Function Documentation

◆ SBDebugger

friend class SBDebugger
friend

Definition at line 246 of file SBCommandInterpreter.h.


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