From fe68904fa6001b29930391722ba1d4401906cb99 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Tue, 10 Nov 2015 17:47:04 +0000 Subject: 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 --- lldb/scripts/Python/python-extensions.swig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lldb/scripts/Python') 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; -- cgit v1.2.3