diff options
author | Filipe Cabecinhas <me@filcab.net> | 2012-08-25 00:29:07 +0000 |
---|---|---|
committer | Filipe Cabecinhas <me@filcab.net> | 2012-08-25 00:29:07 +0000 |
commit | c5041918dda38fbb480ce73da2784ae4765171d3 (patch) | |
tree | ea75625abea7c97cddbbd150967d006b50dbb230 /lldb/scripts/Python/python-extensions.swig | |
parent | de70e0ef454ce294b5526815e8ce657aa6806bff (diff) | |
download | bcm5719-llvm-c5041918dda38fbb480ce73da2784ae4765171d3.tar.gz bcm5719-llvm-c5041918dda38fbb480ce73da2784ae4765171d3.zip |
Added SBDebugger's log callbacks to Python-land
- Tweaked a parameter name in SBDebugger.h so my typemap will catch it;
- Added a SBDebugger.Create(bool, callback, baton) to the swig interface;
- Added SBDebugger.SetLoggingCallback to the swig interface;
- Added a callback utility function for log callbacks;
- Guard against Py_None on both callback utility functions;
- Added a FIXME to the SBDebugger API test;
- Added a __del__() stub for SBDebugger.
We need to be able to get both the log callback and baton from an
SBDebugger if we want to protect against memory leaks (or make the user
responsible for holding another reference to the callback).
Additionally, it's impossible to revert from a callback-backed log
mechanism to a file-backed log mechanism.
llvm-svn: 162633
Diffstat (limited to 'lldb/scripts/Python/python-extensions.swig')
-rw-r--r-- | lldb/scripts/Python/python-extensions.swig | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig index 24f06a189f7..da70f205059 100644 --- a/lldb/scripts/Python/python-extensions.swig +++ b/lldb/scripts/Python/python-extensions.swig @@ -484,6 +484,15 @@ } } + +// %extend lldb::SBDebugger { +// // FIXME: We can't get the callback and baton +// PyObject *lldb::SBDebugger (){ +// // Only call Py_XDECREF if we have a Python object (or NULL) +// if (LLDBSwigPythonCallPythonLogOutputCallback == $self->GetLogOutPutCallback()) +// Py_XDECREF($self->GetCallbackBaton()); +// } +// } // %extend lldb::SBInputReader { // // FIXME: m_callback_function is private and we have no other // // way to access it. @@ -686,4 +695,3 @@ class value(object): def __neq__(self, other): return not self.__eq__(other) %} - |