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]

__setattr__(self, name, value) x.__setattr__('name', value) <==> x.name = value | source code

__getattr__(self, name) | source code

__repr__(self) repr(x) | source code

__init__(self, *args) __init__(lldb::SBCommandInterpreter self, SBCommandInterpreter rhs) -> SBCommandInterpreter | source code

__swig_destroy__(...) delete_SBCommandInterpreter(SBCommandInterpreter self) |

__del__(self) | source code

__nonzero__(self) | source code

IsValid(self) IsValid(SBCommandInterpreter self) -> bool | source code

CommandExists(self, *args) CommandExists(SBCommandInterpreter self, str const * cmd) -> bool | source code

AliasExists(self, *args) AliasExists(SBCommandInterpreter self, str const * cmd) -> bool | source code

GetBroadcaster(self) GetBroadcaster(SBCommandInterpreter self) -> SBBroadcaster | 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, str const * command_line, SBCommandReturnObject result, bool add_to_history=False) -> lldb::ReturnStatus HandleCommand(SBCommandInterpreter self, str const * command_line, SBCommandReturnObject result) -> lldb::ReturnStatus | source code

HandleCompletion(self, *args) HandleCompletion(SBCommandInterpreter self, str const * current_line, uint32_t cursor_pos, int match_start_point, int max_return_elements, ... | source code

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__sizeof__`, `__str__`, `__subclasshook__`

Static Methods | [hide private]

GetArgumentTypeAsCString(*args) GetArgumentTypeAsCString(lldb::CommandArgumentType const arg_type) -> str const * | source code

GetArgumentDescriptionAsCString(*args) GetArgumentDescriptionAsCString(lldb::CommandArgumentType const arg_type) -> str const * | source code

str const *

GetBroadcasterClass() | source code

Class Variables | [hide private]

| __swig_setmethods__ = ``{``}``
| __swig_getmethods__ = `{}`
| eBroadcastBitThreadShouldExit = `1`
| eBroadcastBitResetPrompt = `2`
| eBroadcastBitQuitCommandReceived = `4`
| eBroadcastBitAsynchronousOutputData = `8`
| eBroadcastBitAsynchronousErrorData = `16`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __setattr__(self, name, value)

source code

x.__setattr__('name', value) <==> x.name = value

Overrides: object.__setattr__
  (inherited documentation)

### __repr__(self)
(Representation operator)

source code

repr(x)

Overrides: object.__repr__
  (inherited documentation)

### __init__(self, *args)
(Constructor)

source code

__init__(lldb::SBCommandInterpreter self, SBCommandInterpreter rhs) -> SBCommandInterpreter

Overrides: object.__init__

### HandleCompletion(self, *args)

source code

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