summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api/debugger/TestDebuggerAPI.py
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2012-08-25 00:29:07 +0000
committerFilipe Cabecinhas <me@filcab.net>2012-08-25 00:29:07 +0000
commitc5041918dda38fbb480ce73da2784ae4765171d3 (patch)
treeea75625abea7c97cddbbd150967d006b50dbb230 /lldb/test/python_api/debugger/TestDebuggerAPI.py
parentde70e0ef454ce294b5526815e8ce657aa6806bff (diff)
downloadbcm5719-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/test/python_api/debugger/TestDebuggerAPI.py')
-rw-r--r--lldb/test/python_api/debugger/TestDebuggerAPI.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/lldb/test/python_api/debugger/TestDebuggerAPI.py b/lldb/test/python_api/debugger/TestDebuggerAPI.py
index 462933510a9..a560cbe5377 100644
--- a/lldb/test/python_api/debugger/TestDebuggerAPI.py
+++ b/lldb/test/python_api/debugger/TestDebuggerAPI.py
@@ -2,11 +2,10 @@
Test Debugger APIs.
"""
-import os, time
-import re
-import unittest2
-import lldb, lldbutil
-from lldbtest import *
+import os
+import lldb
+from lldbtest import TestBase, python_api_test
+
class DebuggerAPITestCase(TestBase):
@@ -25,6 +24,9 @@ class DebuggerAPITestCase(TestBase):
self.dbg.FindTargetWithFileAndArch(None, None)
self.dbg.SetInternalVariable(None, None, None)
self.dbg.GetInternalVariableValue(None, None)
+ # FIXME (filcab): We must first allow for the swig bindings to know if
+ # a Python callback is set. (Check python-typemaps.swig)
+ #self.dbg.SetLoggingCallback(None)
self.dbg.SetPrompt(None)
self.dbg.SetCurrentPlatform(None)
self.dbg.SetCurrentPlatformSDKRoot(None)
@@ -35,4 +37,3 @@ class DebuggerAPITestCase(TestBase):
target = lldb.SBTarget()
self.assertFalse(target.IsValid())
self.dbg.DeleteTarget(target)
-
OpenPOWER on IntegriCloud