diff options
author | Caroline Tice <ctice@apple.com> | 2010-09-22 23:01:29 +0000 |
---|---|---|
committer | Caroline Tice <ctice@apple.com> | 2010-09-22 23:01:29 +0000 |
commit | dac97f31a38cd97c4c2c0465d8fcd462e7744145 (patch) | |
tree | 82035593be20cfb2c47f61ceca4ebe795c0c431e /lldb/scripts/Python/python-extensions.swig | |
parent | a9424d4f2f9984a05ffe8c29f0c9b3a521829f18 (diff) | |
download | bcm5719-llvm-dac97f31a38cd97c4c2c0465d8fcd462e7744145.tar.gz bcm5719-llvm-dac97f31a38cd97c4c2c0465d8fcd462e7744145.zip |
Remove all the __repr__ methods from the API/*.h files, and put them
into python-extensions.swig, which gets included into lldb.swig, and
adds them back into the classes when swig generates it's C++ file. This
keeps the Python stuff out of the general API classes.
Also fixed a small bug in the copy constructor for SBSymbolContext.
llvm-svn: 114602
Diffstat (limited to 'lldb/scripts/Python/python-extensions.swig')
-rw-r--r-- | lldb/scripts/Python/python-extensions.swig | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig new file mode 100644 index 00000000000..7d706fd0d63 --- /dev/null +++ b/lldb/scripts/Python/python-extensions.swig @@ -0,0 +1,135 @@ + +%extend lldb::SBAddress { + PyObject *lldb::SBAddress::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBBlock { + PyObject *lldb::SBBlock::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBBreakpoint { + PyObject *lldb::SBBreakpoint::__repr__ (){ + lldb::SBStream description; + $self->GetDescription ("full", description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBBreakpointLocation { + PyObject *lldb::SBBreakpointLocation::__repr__ (){ + lldb::SBStream description; + $self->GetDescription ("full", description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBCommandReturnObject { + PyObject *lldb::SBCommandReturnObject::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBCompileUnit { + PyObject *lldb::SBCompileUnit::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBDebugger { + PyObject *lldb::SBDebugger::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBError { + PyObject *lldb::SBError::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBFileSpec { + PyObject *lldb::SBFileSpec::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBFrame { + PyObject *lldb::SBFrame::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBFunction { + PyObject *lldb::SBFunction::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBLineEntry { + PyObject *lldb::SBLineEntry::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBModule { + PyObject *lldb::SBModule::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBProcess { + PyObject *lldb::SBProcess::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBSymbol { + PyObject *lldb::SBSymbol::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBSymbolContext { + PyObject *lldb::SBSymbolContext::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBTarget { + PyObject *lldb::SBTarget::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBThread { + PyObject *lldb::SBThread::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} +%extend lldb::SBValue { + PyObject *lldb::SBValue::__repr__ (){ + lldb::SBStream description; + $self->GetDescription (description); + return PyString_FromString (description.GetData()); + } +} + |