<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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user