| Johnny Chen | fee6e49 | 2011-12-19 22:51:27 +0000 | [diff] [blame] | 1 | """ |
| 2 | Test Debugger APIs. |
| 3 | """ |
| 4 | |
| Filipe Cabecinhas | c504191 | 2012-08-25 00:29:07 +0000 | [diff] [blame] | 5 | import os |
| 6 | import lldb |
| Tamas Berghammer | c8fd130 | 2015-09-30 10:12:40 +0000 | [diff] [blame] | 7 | from lldbtest import * |
| Filipe Cabecinhas | c504191 | 2012-08-25 00:29:07 +0000 | [diff] [blame] | 8 | |
| Johnny Chen | fee6e49 | 2011-12-19 22:51:27 +0000 | [diff] [blame] | 9 | |
| 10 | class DebuggerAPITestCase(TestBase): |
| 11 | |
| Greg Clayton | 4570d3e | 2013-12-10 23:19:29 +0000 | [diff] [blame] | 12 | mydir = TestBase.compute_mydir(__file__) |
| Johnny Chen | fee6e49 | 2011-12-19 22:51:27 +0000 | [diff] [blame] | 13 | |
| Pavel Labath | dc8b2d3 | 2015-10-26 09:28:32 +0000 | [diff] [blame] | 14 | @add_test_categories(['pyapi']) |
| Tamas Berghammer | c8fd130 | 2015-09-30 10:12:40 +0000 | [diff] [blame] | 15 | @no_debug_info_test |
| Johnny Chen | fee6e49 | 2011-12-19 22:51:27 +0000 | [diff] [blame] | 16 | 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 Cabecinhas | c504191 | 2012-08-25 00:29:07 +0000 | [diff] [blame] | 28 | # 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 Chen | fee6e49 | 2011-12-19 22:51:27 +0000 | [diff] [blame] | 31 | self.dbg.SetPrompt(None) |
| 32 | self.dbg.SetCurrentPlatform(None) |
| 33 | self.dbg.SetCurrentPlatformSDKRoot(None) |
| Johnny Chen | 3f0b90d | 2011-12-23 00:53:45 +0000 | [diff] [blame] | 34 | |
| Pavel Labath | dc8b2d3 | 2015-10-26 09:28:32 +0000 | [diff] [blame] | 35 | @add_test_categories(['pyapi']) |
| Johnny Chen | 3f0b90d | 2011-12-23 00:53:45 +0000 | [diff] [blame] | 36 | 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) |