1 """ 2 Test Debugger APIs. 3 """ 4 5 import os 6 import lldb 7 from lldbtest import TestBase, python_api_test 8 9 10 class DebuggerAPITestCase(TestBase): 11 12 mydir = os.path.join("python_api", "debugger") 13 14 @python_api_test 15 def test_debugger_api_boundary_condition(self): 16 """Exercise SBDebugger APIs with boundary conditions.""" 17 self.dbg.HandleCommand(None) 18 self.dbg.SetDefaultArchitecture(None) 19 self.dbg.GetScriptingLanguage(None) 20 self.dbg.CreateTarget(None) 21 self.dbg.CreateTarget(None, None, None, True, lldb.SBError()) 22 self.dbg.CreateTargetWithFileAndTargetTriple(None, None) 23 self.dbg.CreateTargetWithFileAndArch(None, None) 24 self.dbg.FindTargetWithFileAndArch(None, None) 25 self.dbg.SetInternalVariable(None, None, None) 26 self.dbg.GetInternalVariableValue(None, None) 27 # FIXME (filcab): We must first allow for the swig bindings to know if 28 # a Python callback is set. (Check python-typemaps.swig) 29 #self.dbg.SetLoggingCallback(None) 30 self.dbg.SetPrompt(None) 31 self.dbg.SetCurrentPlatform(None) 32 self.dbg.SetCurrentPlatformSDKRoot(None) 33 34 @python_api_test 35 def test_debugger_delete_invalid_target(self): 36 """SBDebugger.DeleteTarget() should not crash LLDB given and invalid target.""" 37 target = lldb.SBTarget() 38 self.assertFalse(target.IsValid()) 39 self.dbg.DeleteTarget(target) 40