blob: 40719777bbea487672196dde23affc1c3782265a [file] [log] [blame]
Johnny Chenfee6e492011-12-19 22:51:27 +00001"""
2Test Debugger APIs.
3"""
4
Filipe Cabecinhasc5041912012-08-25 00:29:07 +00005import os
6import lldb
Tamas Berghammerc8fd1302015-09-30 10:12:40 +00007from lldbtest import *
Filipe Cabecinhasc5041912012-08-25 00:29:07 +00008
Johnny Chenfee6e492011-12-19 22:51:27 +00009
10class DebuggerAPITestCase(TestBase):
11
Greg Clayton4570d3e2013-12-10 23:19:29 +000012 mydir = TestBase.compute_mydir(__file__)
Johnny Chenfee6e492011-12-19 22:51:27 +000013
Pavel Labathdc8b2d32015-10-26 09:28:32 +000014 @add_test_categories(['pyapi'])
Tamas Berghammerc8fd1302015-09-30 10:12:40 +000015 @no_debug_info_test
Johnny Chenfee6e492011-12-19 22:51:27 +000016 def test_debugger_api_boundary_condition(self):
17 """Exercise SBDebugger APIs with boundary conditions."""
18 self.dbg.HandleCommand(None)
19 self.dbg.SetDefaultArchitecture(None)
20 self.dbg.GetScriptingLanguage(None)
21 self.dbg.CreateTarget(None)
22 self.dbg.CreateTarget(None, None, None, True, lldb.SBError())
23 self.dbg.CreateTargetWithFileAndTargetTriple(None, None)
24 self.dbg.CreateTargetWithFileAndArch(None, None)
25 self.dbg.FindTargetWithFileAndArch(None, None)
26 self.dbg.SetInternalVariable(None, None, None)
27 self.dbg.GetInternalVariableValue(None, None)
Filipe Cabecinhasc5041912012-08-25 00:29:07 +000028 # FIXME (filcab): We must first allow for the swig bindings to know if
29 # a Python callback is set. (Check python-typemaps.swig)
30 #self.dbg.SetLoggingCallback(None)
Johnny Chenfee6e492011-12-19 22:51:27 +000031 self.dbg.SetPrompt(None)
32 self.dbg.SetCurrentPlatform(None)
33 self.dbg.SetCurrentPlatformSDKRoot(None)
Johnny Chen3f0b90d2011-12-23 00:53:45 +000034
Pavel Labathdc8b2d32015-10-26 09:28:32 +000035 @add_test_categories(['pyapi'])
Johnny Chen3f0b90d2011-12-23 00:53:45 +000036 def test_debugger_delete_invalid_target(self):
37 """SBDebugger.DeleteTarget() should not crash LLDB given and invalid target."""
38 target = lldb.SBTarget()
39 self.assertFalse(target.IsValid())
40 self.dbg.DeleteTarget(target)