SBCommandInterpreter

class lldb.SBCommandInterpreter(rhs: lldb.SBCommandInterpreter)

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.

Attributes Summary

eBroadcastBitAsynchronousErrorData
eBroadcastBitAsynchronousOutputData
eBroadcastBitQuitCommandReceived
eBroadcastBitResetPrompt
eBroadcastBitThreadShouldExit

Methods Summary

AliasExists(SBCommandInterpreter self, …)
AllowExitCodeOnQuit(…)
CommandExists(SBCommandInterpreter self, …)
EventIsCommandInterpreterEvent(SBEvent event)
GetArgumentDescriptionAsCString(lldb)
GetArgumentTypeAsCString(lldb)
GetBroadcaster(SBCommandInterpreter self)
GetBroadcasterClass()
GetDebugger(SBCommandInterpreter self)
GetIOHandlerControlSequence(…)
GetProcess(SBCommandInterpreter self)
GetPromptOnQuit(SBCommandInterpreter self)
GetQuitStatus(SBCommandInterpreter self)
HandleCommand(SBCommandInterpreter self, …) HandleCommand(SBCommandInterpreter self, char const * command_line, SBExecutionContext exe_ctx, SBCommandReturnObject result, bool add_to_history=False) -> lldb::ReturnStatus
HandleCommandsFromFile(…)
HandleCompletion(SBCommandInterpreter self, …)
HandleCompletionWithDescriptions(…)
HasAliasOptions(SBCommandInterpreter self)
HasAliases(SBCommandInterpreter self)
HasCommands(SBCommandInterpreter self)
HasCustomQuitExitCode(SBCommandInterpreter self)
IsActive(SBCommandInterpreter self)
IsValid(SBCommandInterpreter self)
ResolveCommand(SBCommandInterpreter self, …)
SetPromptOnQuit(SBCommandInterpreter self, …)
SourceInitFileInCurrentWorkingDirectory(…)
SourceInitFileInHomeDirectory(…)
WasInterrupted(SBCommandInterpreter self)

Attributes Documentation

eBroadcastBitAsynchronousErrorData = <Mock name='mock.SBCommandInterpreter_eBroadcastBitAsynchronousErrorData' id='140526083573072'>
eBroadcastBitAsynchronousOutputData = <Mock name='mock.SBCommandInterpreter_eBroadcastBitAsynchronousOutputData' id='140526083573024'>
eBroadcastBitQuitCommandReceived = <Mock name='mock.SBCommandInterpreter_eBroadcastBitQuitCommandReceived' id='140526083572976'>
eBroadcastBitResetPrompt = <Mock name='mock.SBCommandInterpreter_eBroadcastBitResetPrompt' id='140526083572928'>
eBroadcastBitThreadShouldExit = <Mock name='mock.SBCommandInterpreter_eBroadcastBitThreadShouldExit' id='140526083572736'>

Methods Documentation

AliasExists(SBCommandInterpreter self, char const * cmd) → bool
AllowExitCodeOnQuit(SBCommandInterpreter self, bool b)
CommandExists(SBCommandInterpreter self, char const * cmd) → bool
static EventIsCommandInterpreterEvent(SBEvent event) → bool
static GetArgumentDescriptionAsCString(lldb::CommandArgumentType const arg_type) → char const *
static GetArgumentTypeAsCString(lldb::CommandArgumentType const arg_type) → char const *
GetBroadcaster(SBCommandInterpreter self) → SBBroadcaster
static GetBroadcasterClass() → char const *
GetDebugger(SBCommandInterpreter self) → SBDebugger
GetIOHandlerControlSequence(SBCommandInterpreter self, char ch) → char const *
GetProcess(SBCommandInterpreter self) → SBProcess
GetPromptOnQuit(SBCommandInterpreter self) → bool
GetQuitStatus(SBCommandInterpreter self) → int
HandleCommand(SBCommandInterpreter self, char const * command_line, SBCommandReturnObject result, bool add_to_history=False) → lldb::ReturnStatus

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

HandleCommandsFromFile(SBCommandInterpreter self, SBFileSpec file, SBExecutionContext override_context, SBCommandInterpreterRunOptions options, SBCommandReturnObject result)
HandleCompletion(SBCommandInterpreter self, char const * current_line, uint32_t cursor_pos, int match_start_point, int max_return_elements, SBStringList matches) → int
HandleCompletionWithDescriptions(SBCommandInterpreter self, char const * current_line, uint32_t cursor_pos, int match_start_point, int max_return_elements, SBStringList matches, SBStringList descriptions) → int
HasAliasOptions(SBCommandInterpreter self) → bool
HasAliases(SBCommandInterpreter self) → bool
HasCommands(SBCommandInterpreter self) → bool
HasCustomQuitExitCode(SBCommandInterpreter self) → bool
IsActive(SBCommandInterpreter self) → bool
IsValid(SBCommandInterpreter self) → bool
ResolveCommand(SBCommandInterpreter self, char const * command_line, SBCommandReturnObject result)
SetPromptOnQuit(SBCommandInterpreter self, bool b)
SourceInitFileInCurrentWorkingDirectory(SBCommandInterpreter self, SBCommandReturnObject result)
SourceInitFileInHomeDirectory(SBCommandInterpreter self, SBCommandReturnObject result)
WasInterrupted(SBCommandInterpreter self) → bool