diff options
author | Greg Clayton <gclayton@apple.com> | 2013-07-08 22:22:41 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-07-08 22:22:41 +0000 |
commit | 226cce25116af0f3132941b27492f349f62052a4 (patch) | |
tree | aeee7174537ac09c746b680bcf52cf298ed2a7c0 /lldb/scripts/Python/python-extensions.swig | |
parent | 8bad86c81be924bdfe1814da69dafda8b0237503 (diff) | |
download | bcm5719-llvm-226cce25116af0f3132941b27492f349f62052a4.tar.gz bcm5719-llvm-226cce25116af0f3132941b27492f349f62052a4.zip |
Added a way to extract the module specifications from a file. A module specification is information that is required to describe a module (executable, shared library, object file, ect). This information includes host path, platform path (remote path), symbol file path, UUID, object name (for objects in .a files for example you could have an object name of "foo.o"), and target triple. Module specification can be used to create a module, or used to add a module to a target. A list of module specifications can be used to enumerate objects in container objects (like universal mach files and BSD archive files).
There are two new classes:
lldb::SBModuleSpec
lldb::SBModuleSpecList
The SBModuleSpec wraps up a lldb_private::ModuleSpec, and SBModuleSpecList wraps up a lldb_private::ModuleSpecList.
llvm-svn: 185877
Diffstat (limited to 'lldb/scripts/Python/python-extensions.swig')
-rw-r--r-- | lldb/scripts/Python/python-extensions.swig | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig index 14dc044856e..c4bc8b9141b 100644 --- a/lldb/scripts/Python/python-extensions.swig +++ b/lldb/scripts/Python/python-extensions.swig @@ -353,6 +353,37 @@ return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} } + +%extend lldb::SBModuleSpec { + PyObject *lldb::SBModuleSpec::__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::SBModuleSpecList { + PyObject *lldb::SBModuleSpecList::__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::SBProcess { PyObject *lldb::SBProcess::__str__ (){ lldb::SBStream description; |