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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162633 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/scripts/Python/python-extensions.swig b/scripts/Python/python-extensions.swig
index 24f06a1..da70f20 100644
--- a/scripts/Python/python-extensions.swig
+++ b/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 @@
     def __neq__(self, other):
         return not self.__eq__(other)
 %}
-