diff options
Diffstat (limited to 'lldb/scripts/Python/python-extensions.swig')
-rw-r--r-- | lldb/scripts/Python/python-extensions.swig | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig index c6c12fc0efc..29e39e54e57 100644 --- a/lldb/scripts/Python/python-extensions.swig +++ b/lldb/scripts/Python/python-extensions.swig @@ -280,6 +280,20 @@ return PyString_FromString(""); } } +%extend lldb::SBSymbolContextList { + PyObject *lldb::SBSymbolContextList::__str__ (){ + lldb::SBStream description; + $self->GetDescription (description); + const char *desc = description.GetData(); + size_t desc_len = description.GetSize(); + if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) + --desc_len; + if (desc_len > 0) + return PyString_FromStringAndSize (desc, desc_len); + else + return PyString_FromString(""); + } +} %extend lldb::SBTarget { PyObject *lldb::SBTarget::__str__ (){ lldb::SBStream description; @@ -389,6 +403,13 @@ %pythoncode %{ +class declaration(object): + '''A class that represents a source declaration location with file, line and column.''' + def __init__(self, file, line, col): + self.file = file + self.line = line + self.col = col + class value(object): '''A class designed to wrap lldb.SBValue() objects so the resulting object can be used as a variable would be in code. So if you have a Point structure |