From ef5d0b5e97ec8e6fa395d377b09aa7755e345b4f Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 18 Dec 2017 20:12:36 +0000 Subject: Vendor import of lldb trunk r321017: https://llvm.org/svn/llvm-project/lldb/trunk@321017 --- scripts/Python/python-extensions.swig | 15 +++++++++++++++ scripts/Python/python-swigsafecast.swig | 7 +++++++ 2 files changed, 22 insertions(+) (limited to 'scripts/Python') diff --git a/scripts/Python/python-extensions.swig b/scripts/Python/python-extensions.swig index 693b06b9aab3..d79917b92158 100644 --- a/scripts/Python/python-extensions.swig +++ b/scripts/Python/python-extensions.swig @@ -71,6 +71,21 @@ } } +%extend lldb::SBBreakpointName { + PyObject *lldb::SBBreakpointName::__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 lldb_private::PythonString(llvm::StringRef(desc, desc_len)).release(); + else + return lldb_private::PythonString("").release(); + } +} + %extend lldb::SBBroadcaster { %pythoncode %{ def __eq__(self, rhs): diff --git a/scripts/Python/python-swigsafecast.swig b/scripts/Python/python-swigsafecast.swig index ea3f21f859ad..ffd7546323a0 100644 --- a/scripts/Python/python-swigsafecast.swig +++ b/scripts/Python/python-swigsafecast.swig @@ -113,6 +113,13 @@ SBTypeToSWIGWrapper (lldb::SBBreakpointLocation* breakpoint_location_sb) return SWIG_NewPointerObj((void *) breakpoint_location_sb, SWIGTYPE_p_lldb__SBBreakpointLocation, 0); } +template <> +PyObject* +SBTypeToSWIGWrapper (lldb::SBBreakpointName* breakpoint_name_sb) +{ + return SWIG_NewPointerObj((void *) breakpoint_name_sb, SWIGTYPE_p_lldb__SBBreakpointName, 0); +} + template <> PyObject* SBTypeToSWIGWrapper (lldb::SBValue* value_sb) -- cgit v1.2.3