SBCommandInterpreterΒΆ

class lldb.SBCommandInterpreter(*args)ΒΆ

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

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)

GetStatistics(SBCommandInterpreter self)

GetTranscript(SBCommandInterpreter self)

HandleCommand(-> lldb)

HandleCommandsFromFile(...)

HandleCompletion(SBCommandInterpreter self, ...)

HandleCompletionWithDescriptions(...)

HasAliasOptions(SBCommandInterpreter self)

HasAliases(SBCommandInterpreter self)

HasCommands(SBCommandInterpreter self)

HasCustomQuitExitCode(SBCommandInterpreter self)

InterruptCommand(SBCommandInterpreter self)

IsActive(SBCommandInterpreter self)

IsInteractive(SBCommandInterpreter self)

IsValid(SBCommandInterpreter self)

ResolveCommand(SBCommandInterpreter self, ...)

SetCommandOverrideCallback(...)

SetPromptOnQuit(SBCommandInterpreter self, ...)

SourceInitFileInCurrentWorkingDirectory(...)

SourceInitFileInHomeDirectory()

UserCommandExists(SBCommandInterpreter self, ...)

WasInterrupted(SBCommandInterpreter self)

Attributes Documentation

eBroadcastBitAsynchronousErrorData = <Mock name='mock.SBCommandInterpreter_eBroadcastBitAsynchronousErrorData' id='140507146827088'>ΒΆ
eBroadcastBitAsynchronousOutputData = <Mock name='mock.SBCommandInterpreter_eBroadcastBitAsynchronousOutputData' id='140507146827664'>ΒΆ
eBroadcastBitQuitCommandReceived = <Mock name='mock.SBCommandInterpreter_eBroadcastBitQuitCommandReceived' id='140507146828112'>ΒΆ
eBroadcastBitResetPrompt = <Mock name='mock.SBCommandInterpreter_eBroadcastBitResetPrompt' id='140507146828240'>ΒΆ
eBroadcastBitThreadShouldExit = <Mock name='mock.SBCommandInterpreter_eBroadcastBitThreadShouldExit' id='140507146828304'>ΒΆ

Methods Documentation

AliasExists(SBCommandInterpreter self, char const * cmd) boolΒΆ
AllowExitCodeOnQuit(SBCommandInterpreter self, bool allow)ΒΆ
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ΒΆ
GetStatistics(SBCommandInterpreter self) SBStructuredDataΒΆ
GetTranscript(SBCommandInterpreter self) SBStructuredDataΒΆ
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ΒΆ
InterruptCommand(SBCommandInterpreter self) boolΒΆ
IsActive(SBCommandInterpreter self) boolΒΆ
IsInteractive(SBCommandInterpreter self) boolΒΆ
IsValid(SBCommandInterpreter self) boolΒΆ
ResolveCommand(SBCommandInterpreter self, char const * command_line, SBCommandReturnObject result)ΒΆ
SetCommandOverrideCallback(SBCommandInterpreter self, char const * command_name, lldb::CommandOverrideCallback callback) boolΒΆ
SetPromptOnQuit(SBCommandInterpreter self, bool b)ΒΆ
SourceInitFileInCurrentWorkingDirectory(SBCommandInterpreter self, SBCommandReturnObject result)ΒΆ
SourceInitFileInHomeDirectory(SBCommandInterpreter self, SBCommandReturnObject result)ΒΆ
SourceInitFileInHomeDirectory(SBCommandInterpreter self, SBCommandReturnObject result, bool is_repl) None
UserCommandExists(SBCommandInterpreter self, char const * cmd) boolΒΆ
WasInterrupted(SBCommandInterpreter self) boolΒΆ