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.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114602 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/scripts/Python/python-extensions.swig b/scripts/Python/python-extensions.swig
new file mode 100644
index 0000000..7d706fd
--- /dev/null
+++ b/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());
+ }
+}
+