From da7bc7d0000fe700493363036e792b929e86cb60 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Sun, 13 Nov 2011 06:57:31 +0000 Subject: Fixed an issues with the SBType and SBTypeMember classes: - Fixed SBType to be able to dump itself from python - Fixed SBType::GetNumberOfFields() to return the correct value for objective C interfaces - Fixed SBTypeMember to be able to dump itself from python - Fixed the SBTypeMember ability to get a field offset in bytes (the value being returned was wrong) - Added the SBTypeMember ability to get a field offset in bits Cleaned up a lot of the Stream usage in the SB API files. llvm-svn: 144493 --- lldb/scripts/Python/python-extensions.swig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lldb/scripts/Python/python-extensions.swig') diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig index 52ec68e..c50e43d 100644 --- a/lldb/scripts/Python/python-extensions.swig +++ b/lldb/scripts/Python/python-extensions.swig @@ -146,6 +146,20 @@ return PyString_FromString (description.GetData()); } } +%extend lldb::SBType { + PyObject *lldb::SBType::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description, lldb::eDescriptionLevelBrief); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBTypeMember { + PyObject *lldb::SBTypeMember::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description, lldb::eDescriptionLevelBrief); + return PyString_FromString (description.GetData()); + } +} %extend lldb::SBThread { PyObject *lldb::SBThread::__repr__ (){ lldb::SBStream description; -- cgit v1.1