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)GetArgumentTypeAsCString
(lldb)GetBroadcaster
(SBCommandInterpreter self)GetDebugger
(SBCommandInterpreter self)GetProcess
(SBCommandInterpreter self)GetPromptOnQuit
(SBCommandInterpreter self)GetQuitStatus
(SBCommandInterpreter self)GetStatistics
(SBCommandInterpreter self)GetTranscript
(SBCommandInterpreter self)HandleCommand
(-> lldb)HandleCompletion
(SBCommandInterpreter self, ...)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, ...)SetPromptOnQuit
(SBCommandInterpreter self, ...)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 * ΒΆ
- 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 ΒΆ