From 4d32eb6939d77f8059683c008bb807167110e930 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Fri, 24 Jun 2016 23:40:35 +0000 Subject: Add .i files for SBMemoryRegionInfo and SBMemoryRegionInfoList and also hook up the new calls in SBProcess that give out SBMemoryRegionInfo and SBMemoryRegionInfoList objects. Also make sure the right headers and .i files are included so SWIG can hook everything up. llvm-svn: 273749 --- lldb/scripts/Python/python-extensions.swig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lldb/scripts/Python') diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig index 487bf1e3599..693b06b9aab 100644 --- a/lldb/scripts/Python/python-extensions.swig +++ b/lldb/scripts/Python/python-extensions.swig @@ -325,6 +325,22 @@ return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} } + +%extend lldb::SBMemoryRegionInfo { + PyObject *lldb::SBMemoryRegionInfo::__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::SBModule { PyObject *lldb::SBModule::__str__ (){ lldb::SBStream description; -- cgit v1.2.3