diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2020-01-07 12:46:01 -0800 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2020-01-07 12:47:00 -0800 |
commit | fe27e8ee80c708b1b79b08eb217f94f3d87d4052 (patch) | |
tree | 31c71a1256799a8dc9513d0110f5f639f63503cf /lldb/scripts/Python | |
parent | 76ee0de00c407399b0aa7d282c589739b818b3dc (diff) | |
download | bcm5719-llvm-fe27e8ee80c708b1b79b08eb217f94f3d87d4052.tar.gz bcm5719-llvm-fe27e8ee80c708b1b79b08eb217f94f3d87d4052.zip |
Revert "[lldb/Lua] Add string conversion operator for SBTarget."
This reverts commit 640d0ba8760051afc002c672121c6989517fc94e.
Diffstat (limited to 'lldb/scripts/Python')
-rw-r--r-- | lldb/scripts/Python/python-extensions.swig | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig index 51b7e477911..c10c32b4487 100644 --- a/lldb/scripts/Python/python-extensions.swig +++ b/lldb/scripts/Python/python-extensions.swig @@ -502,6 +502,18 @@ } %extend lldb::SBTarget { + %nothreadallow; + PyObject *lldb::SBTarget::__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; + return PythonString(llvm::StringRef(desc, desc_len)).release(); + } + %clearnothreadallow; + %pythoncode %{ def __eq__(self, rhs): if not isinstance(rhs, type(self)): |