<rdar://problem/12462744> Implement a new SBDeclaration class to wrap an lldb_private::Declaration - make a GetDeclaration() API on SBValue to return a declaration. This will only work for vroot variables as they are they only objects for which we currently provide a valid Declaration

llvm-svn: 165672
This commit is contained in:
Enrico Granata
2012-10-10 22:54:17 +00:00
parent a529f8c9c2
commit 10de09044e
14 changed files with 406 additions and 0 deletions

View File

@@ -111,6 +111,20 @@
return PyString_FromString("");
}
}
%extend lldb::SBDeclaration {
PyObject *lldb::SBDeclaration::__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::SBError {
PyObject *lldb::SBError::__str__ (){
lldb::SBStream description;