summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2015-11-10 17:47:04 +0000
committerGreg Clayton <gclayton@apple.com>2015-11-10 17:47:04 +0000
commitfe68904fa6001b29930391722ba1d4401906cb99 (patch)
tree709ad40609f5bb22f4a1da8e8019e21dfd10a1c5 /lldb/scripts/Python
parenta01a5ee72fe164f772df9a02bdd9e3e489556ec3 (diff)
downloadbcm5719-llvm-fe68904fa6001b29930391722ba1d4401906cb99.tar.gz
bcm5719-llvm-fe68904fa6001b29930391722ba1d4401906cb99.zip
Fixed TypeMemberFunctionImpl to not use clang types directly but use the new CompilerDecl class to do the job in an abstract way.
Fixed a crash that would happen if you tried to get the name of a constructor or destructor by calling "getDeclName()" instead of calling getName() (which would assert and crash). Added the ability to get function arguments names from SBFunction. llvm-svn: 252622
Diffstat (limited to 'lldb/scripts/Python')
-rw-r--r--lldb/scripts/Python/python-extensions.swig14
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig
index 90c9803c1b3..e81d0d9795e 100644
--- a/lldb/scripts/Python/python-extensions.swig
+++ b/lldb/scripts/Python/python-extensions.swig
@@ -608,6 +608,20 @@
return lldb_private::PythonString("").release();
}
}
+%extend lldb::SBTypeMemberFunction {
+ PyObject *lldb::SBTypeMemberFunction::__str__ (){
+ lldb::SBStream description;
+ $self->GetDescription (description, lldb::eDescriptionLevelBrief);
+ 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 lldb_private::PythonString(llvm::StringRef(desc, desc_len)).release();
+ else
+ return lldb_private::PythonString("").release();
+ }
+}
%extend lldb::SBTypeEnumMember {
PyObject *lldb::SBTypeEnumMember::__str__ (){
lldb::SBStream description;
OpenPOWER on IntegriCloud