Package lldb :: Class SBError

[hide private]
[frames] | no frames]

# Class SBError

source code

    Represents a container for holding any error code.

    For example (from test/python_api/hello_world/TestHelloWorld.py),

        def hello_world_attach_with_id_api(self):
            '''Create target, spawn a process, and attach to it by id.'''

            target = self.dbg.CreateTarget(self.exe)

            # Spawn a new process and don't display the stdout if not in TraceOn() mode.
            import subprocess
            popen = subprocess.Popen([self.exe, 'abc', 'xyz'],
                                     stdout = open(os.devnull, 'w') if not self.TraceOn() else None)

            listener = lldb.SBListener('my.attach.listener')
            error = lldb.SBError()
            process = target.AttachToProcessWithID(listener, popen.pid, error)

            self.assertTrue(error.Success() and process, PROCESS_IS_VALID)

            # Let's check the stack traces of the attached process.
            import lldbutil
            stacktraces = lldbutil.print_stacktraces(process, string_buffer=True)
            self.expect(stacktraces, exe=False,
                substrs = ['main.c:%d' % self.line2,
                           '(int)argc=3'])

            listener = lldb.SBListener('my.attach.listener')
            error = lldb.SBError()
            process = target.AttachToProcessWithID(listener, popen.pid, error)

            self.assertTrue(error.Success() and process, PROCESS_IS_VALID)

    checks that after the attach, there is no error condition by asserting
    that error.Success() is True and we get back a valid process object.

    And (from test/python_api/event/TestEvent.py),

            # Now launch the process, and do not stop at entry point.
            error = lldb.SBError()
            process = target.Launch(listener, None, None, None, None, None, None, 0, False, error)
            self.assertTrue(error.Success() and process, PROCESS_IS_VALID)

    checks that after calling the target.Launch() method there's no error
    condition and we get back a void process object.

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::SBError self) -> SBError __init__(lldb::SBError self, SBError rhs) -> SBError | source code

__swig_destroy__(...) delete_SBError(SBError self) |

__del__(self) | source code

GetCString(self) GetCString(SBError self) -> str const * | source code

Clear(self) Clear(SBError self) | source code

Fail(self) Fail(SBError self) -> bool | source code

Success(self) Success(SBError self) -> bool | source code

GetError(self) GetError(SBError self) -> uint32_t | source code

GetType(self) GetType(SBError self) -> lldb::ErrorType | source code

SetError(self, *args) SetError(SBError self, uint32_t err, lldb::ErrorType type) | source code

SetErrorToErrno(self) SetErrorToErrno(SBError self) | source code

SetErrorToGenericError(self) SetErrorToGenericError(SBError self) | source code

SetErrorString(self, *args) SetErrorString(SBError self, str const * err_str) | source code

SetErrorStringWithFormat(self, *args) SetErrorStringWithFormat(SBError self, str const * format) -> int | source code

__nonzero__(self) | source code

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

GetDescription(self, *args) GetDescription(SBError self, SBStream description) -> bool | source code

__str__(self) __str__(SBError self) -> PyObject * | source code

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

Class Variables | [hide private]

| __swig_setmethods__ = ``{``}``
| __swig_getmethods__ = `{}`

Properties | [hide private]

| description A read only property that returns the same result as GetCString().
| fail A read only property that returns the same result as Fail().
| success A read only property that returns the same result as Success().
| type A read only property that returns the same result as GetType().
| value A read only property that returns the same result as GetError().
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::SBError self) -> SBError __init__(lldb::SBError self, SBError rhs) -> SBError

Overrides: object.__init__

### __str__(self)
(Informal representation operator)

source code

__str__(SBError self) -> PyObject *

Overrides: object.__str__

Property Details | [hide private]

### description

A read only property that returns the same result as GetCString().

Get Method:
  GetCString(self) - GetCString(SBError self) -> str const *

### fail

A read only property that returns the same result as Fail().

Get Method:
  Fail(self) - Fail(SBError self) -> bool

### success

A read only property that returns the same result as Success().

Get Method:
  Success(self) - Success(SBError self) -> bool

### type

A read only property that returns the same result as GetType().

Get Method:
  GetType(self) - GetType(SBError self) -> lldb::ErrorType

### value

A read only property that returns the same result as GetError().

Get Method:
  GetError(self) - GetError(SBError self) -> uint32_t