Package lldb :: Class SBCommandInterpreter
[hide private]
[frames] | no frames]

Class SBCommandInterpreter

source code



SBCommandInterpreter handles/interprets commands for lldb.  You get the
command interpreter from the SBDebugger instance. For example (from test/
python_api/interpreter/TestCommandInterpreterAPI.py),

    def command_interpreter_api(self):
        '''Test the SBCommandInterpreter APIs.'''
        exe = os.path.join(os.getcwd(), 'a.out')

        # Create a target by the debugger.
        target = self.dbg.CreateTarget(exe)
        self.assertTrue(target, VALID_TARGET)

        # Retrieve the associated command interpreter from our debugger.
        ci = self.dbg.GetCommandInterpreter()
        self.assertTrue(ci, VALID_COMMAND_INTERPRETER)

        # Exercise some APIs....

        self.assertTrue(ci.HasCommands())
        self.assertTrue(ci.HasAliases())
        self.assertTrue(ci.HasAliasOptions())
        self.assertTrue(ci.CommandExists('breakpoint'))
        self.assertTrue(ci.CommandExists('target'))
        self.assertTrue(ci.CommandExists('platform'))
        self.assertTrue(ci.AliasExists('file'))
        self.assertTrue(ci.AliasExists('run'))
        self.assertTrue(ci.AliasExists('bt'))

        res = lldb.SBCommandReturnObject()
        ci.HandleCommand('breakpoint set -f main.c -l %d' % self.line, res)
        self.assertTrue(res.Succeeded())
        ci.HandleCommand('process launch', res)
        self.assertTrue(res.Succeeded())

        process = ci.GetProcess()
        self.assertTrue(process)

        ...

The HandleCommand() instance method takes two args: the command string and
an SBCommandReturnObject instance which encapsulates the result of command
execution.

Instance Methods [hide private]
 
__repr__(self) source code
 
__init__(self, *args)
__init__(lldb::SBCommandInterpreter self, SBCommandInterpreter rhs) -> SBCommandInterpreter
source code
 
GetArgumentTypeAsCString(*args)
GetArgumentTypeAsCString(lldb::CommandArgumentType const arg_type) -> char const *
source code
 
GetArgumentDescriptionAsCString(*args)
GetArgumentDescriptionAsCString(lldb::CommandArgumentType const arg_type) -> char const *
source code
 
EventIsCommandInterpreterEvent(*args)
EventIsCommandInterpreterEvent(SBEvent event) -> bool
source code
 
IsValid(self)
IsValid(SBCommandInterpreter self) -> bool
source code
 
__nonzero__(self) source code
 
__bool__(self) source code
 
GetIOHandlerControlSequence(self, *args)
GetIOHandlerControlSequence(SBCommandInterpreter self, char ch) -> char const *
source code
 
GetPromptOnQuit(self)
GetPromptOnQuit(SBCommandInterpreter self) -> bool
source code
 
SetPromptOnQuit(self, *args)
SetPromptOnQuit(SBCommandInterpreter self, bool b)
source code
 
AllowExitCodeOnQuit(self, *args)
AllowExitCodeOnQuit(SBCommandInterpreter self, bool b)
source code
 
HasCustomQuitExitCode(self)
HasCustomQuitExitCode(SBCommandInterpreter self) -> bool
source code
 
GetQuitStatus(self)
GetQuitStatus(SBCommandInterpreter self) -> int
source code
 
ResolveCommand(self, *args)
ResolveCommand(SBCommandInterpreter self, char const * command_line, SBCommandReturnObject result)
source code
 
CommandExists(self, *args)
CommandExists(SBCommandInterpreter self, char const * cmd) -> bool
source code
 
AliasExists(self, *args)
AliasExists(SBCommandInterpreter self, char const * cmd) -> bool
source code
 
GetBroadcaster(self)
GetBroadcaster(SBCommandInterpreter self) -> SBBroadcaster
source code
char const *
GetBroadcasterClass() source code
 
HasCommands(self)
HasCommands(SBCommandInterpreter self) -> bool
source code
 
HasAliases(self)
HasAliases(SBCommandInterpreter self) -> bool
source code
 
HasAliasOptions(self)
HasAliasOptions(SBCommandInterpreter self) -> bool
source code
 
GetProcess(self)
GetProcess(SBCommandInterpreter self) -> SBProcess
source code
 
GetDebugger(self)
GetDebugger(SBCommandInterpreter self) -> SBDebugger
source code
 
SourceInitFileInHomeDirectory(self, *args)
SourceInitFileInHomeDirectory(SBCommandInterpreter self, SBCommandReturnObject result)
source code
 
SourceInitFileInCurrentWorkingDirectory(self, *args)
SourceInitFileInCurrentWorkingDirectory(SBCommandInterpreter self, SBCommandReturnObject result)
source code
 
HandleCommand(self, *args)
HandleCommand(SBCommandInterpreter self, char const * command_line, SBCommandReturnObject result, bool add_to_history=False) -> lldb::ReturnStatus...
source code
 
HandleCommandsFromFile(self, *args)
HandleCommandsFromFile(SBCommandInterpreter self, SBFileSpec file, SBExecutionContext override_context, SBCommandInterpreterRunOptions options, ...
source code
 
HandleCompletion(self, *args)
HandleCompletion(SBCommandInterpreter self, char const * current_line, uint32_t cursor_pos, int match_start_point, int max_return_elements, ...
source code
 
HandleCompletionWithDescriptions(self, *args)
HandleCompletionWithDescriptions(SBCommandInterpreter self, char const * current_line, uint32_t cursor_pos, int match_start_point, int max_return_elements, ...
source code
 
IsActive(self)
IsActive(SBCommandInterpreter self) -> bool
source code
 
WasInterrupted(self)
WasInterrupted(SBCommandInterpreter self) -> bool
source code
Class Variables [hide private]
  __swig_setmethods__ = {}
  __setattr__ = lambda self, name, value:
  __swig_getmethods__ = {}
  __getattr__ = lambda self, name:
  eBroadcastBitThreadShouldExit = _lldb.SBCommandInterpreter_eBr...
  eBroadcastBitResetPrompt = _lldb.SBCommandInterpreter_eBroadca...
  eBroadcastBitQuitCommandReceived = _lldb.SBCommandInterpreter_...
  eBroadcastBitAsynchronousOutputData = _lldb.SBCommandInterpret...
  eBroadcastBitAsynchronousErrorData = _lldb.SBCommandInterprete...
  __swig_destroy__ = _lldb.delete_SBCommandInterpreter
  __del__ = lambda self:
Method Details [hide private]

HandleCommand(self, *args)

source code 

HandleCommand(SBCommandInterpreter self, char const * command_line, SBCommandReturnObject result, bool add_to_history=False) -> lldb::ReturnStatus
HandleCommand(SBCommandInterpreter self, char const * command_line, SBCommandReturnObject result) -> lldb::ReturnStatus
HandleCommand(SBCommandInterpreter self, char const * command_line, SBExecutionContext exe_ctx, SBCommandReturnObject result, 
    bool add_to_history=False) -> lldb::ReturnStatus
HandleCommand(SBCommandInterpreter self, char const * command_line, SBExecutionContext exe_ctx, SBCommandReturnObject result) -> lldb::ReturnStatus

HandleCommandsFromFile(self, *args)

source code 

HandleCommandsFromFile(SBCommandInterpreter self, SBFileSpec file, SBExecutionContext override_context, SBCommandInterpreterRunOptions options, 
    SBCommandReturnObject result)

HandleCompletion(self, *args)

source code 

HandleCompletion(SBCommandInterpreter self, char const * current_line, uint32_t cursor_pos, int match_start_point, int max_return_elements, 
    SBStringList matches) -> int

HandleCompletionWithDescriptions(self, *args)

source code 

HandleCompletionWithDescriptions(SBCommandInterpreter self, char const * current_line, uint32_t cursor_pos, int match_start_point, int max_return_elements, 
    SBStringList matches, SBStringList descriptions) -> int


Class Variable Details [hide private]

eBroadcastBitThreadShouldExit

Value:
_lldb.SBCommandInterpreter_eBroadcastBitThreadShouldExit

eBroadcastBitResetPrompt

Value:
_lldb.SBCommandInterpreter_eBroadcastBitResetPrompt

eBroadcastBitQuitCommandReceived

Value:
_lldb.SBCommandInterpreter_eBroadcastBitQuitCommandReceived

eBroadcastBitAsynchronousOutputData

Value:
_lldb.SBCommandInterpreter_eBroadcastBitAsynchronousOutputData

eBroadcastBitAsynchronousErrorData

Value:
_lldb.SBCommandInterpreter_eBroadcastBitAsynchronousErrorData