]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/python_api/debugger/TestDebuggerAPI.py
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / python_api / debugger / TestDebuggerAPI.py
1 """
2 Test Debugger APIs.
3 """
4
5 import os
6 import lldb
7
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
11
12
13 class DebuggerAPITestCase(TestBase):
14
15     mydir = TestBase.compute_mydir(__file__)
16
17     @add_test_categories(['pyapi'])
18     @no_debug_info_test
19     def test_debugger_api_boundary_condition(self):
20         """Exercise SBDebugger APIs with boundary conditions."""
21         self.dbg.HandleCommand(None)
22         self.dbg.SetDefaultArchitecture(None)
23         self.dbg.GetScriptingLanguage(None)
24         self.dbg.CreateTarget(None)
25         self.dbg.CreateTarget(None, None, None, True, lldb.SBError())
26         self.dbg.CreateTargetWithFileAndTargetTriple(None, None)
27         self.dbg.CreateTargetWithFileAndArch(None, None)
28         self.dbg.FindTargetWithFileAndArch(None, None)
29         self.dbg.SetInternalVariable(None, None, None)
30         self.dbg.GetInternalVariableValue(None, None)
31         # FIXME (filcab): We must first allow for the swig bindings to know if
32         # a Python callback is set. (Check python-typemaps.swig)
33         # self.dbg.SetLoggingCallback(None)
34         self.dbg.SetPrompt(None)
35         self.dbg.SetCurrentPlatform(None)
36         self.dbg.SetCurrentPlatformSDKRoot(None)
37
38     @add_test_categories(['pyapi'])
39     def test_debugger_delete_invalid_target(self):
40         """SBDebugger.DeleteTarget() should not crash LLDB given and invalid target."""
41         target = lldb.SBTarget()
42         self.assertFalse(target.IsValid())
43         self.dbg.DeleteTarget(target)