summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/python-extensions.swig
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2012-08-22 13:25:10 +0000
committerFilipe Cabecinhas <me@filcab.net>2012-08-22 13:25:10 +0000
commit6eb31e7391d27fc4a78122d45138e51eae9d6743 (patch)
treea3bd9bffdd8b1b3583607a0c101f70f1df71e63c /lldb/scripts/Python/python-extensions.swig
parentde17f866559c49c8f8317e42cfaf1468b59922ff (diff)
downloadbcm5719-llvm-6eb31e7391d27fc4a78122d45138e51eae9d6743.tar.gz
bcm5719-llvm-6eb31e7391d27fc4a78122d45138e51eae9d6743.zip
Added a typemap and wrappers for SBInputReader callbacks
Now it's possible to use SBInputReader callbacks in Python. We leak the callback object, unfortunately. A __del__ method can be added to SBInputReader, but we have no way to check the callback function that is on the reader. So we can't call Py_DECREF on it when we have our PythonCallback function. One way to do it is to assume that reified SBInputReaders always have a Python callback (and always call Py_DECREF). Another one is to add methods or properties to SBInputReader (or make the m_callback_function property public). llvm-svn: 162356
Diffstat (limited to 'lldb/scripts/Python/python-extensions.swig')
-rw-r--r--lldb/scripts/Python/python-extensions.swig11
1 files changed, 10 insertions, 1 deletions
diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig
index cd8f1cfc5f0..24f06a189f7 100644
--- a/lldb/scripts/Python/python-extensions.swig
+++ b/lldb/scripts/Python/python-extensions.swig
@@ -25,7 +25,6 @@
return PyString_FromStringAndSize (desc, desc_len);
else
return PyString_FromString("");
-
}
}
%extend lldb::SBBreakpoint {
@@ -485,6 +484,16 @@
}
}
+// %extend lldb::SBInputReader {
+// // FIXME: m_callback_function is private and we have no other
+// // way to access it.
+// PyObject *lldb::SBInputReader::__del__ (){
+// // Only call Py_XDECREF if we have a Python object (or NULL)
+// if (LLDBSwigPythonCallSBInputReaderCallback == $self->m_callback_function)
+// Py_XDECREF($self->m_callback_baton);
+// }
+// }
+
%pythoncode %{
class declaration(object):
OpenPOWER on IntegriCloud