]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/tools/lldb-mi/threadinfo/TestMiThreadInfo.py
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / tools / lldb-mi / threadinfo / TestMiThreadInfo.py
1 """
2 Test lldb-mi -thread-info command.
3 """
4
5 from __future__ import print_function
6
7 import lldbmi_testcase
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
11
12
13 class MiThreadInfoTestCase(lldbmi_testcase.MiTestCaseBase):
14
15     mydir = TestBase.compute_mydir(__file__)
16
17     @skipIfWindows  # pthreads not supported on Windows
18     @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread races
19     def test_lldbmi_thread_info(self):
20         """Test that -thread-info prints thread info and the current-thread-id"""
21
22         self.spawnLldbMi(args=None)
23
24         # Load executable
25         self.runCmd("-file-exec-and-symbols %s" % self.myexe)
26         self.expect("\^done")
27
28         self.runCmd("-break-insert ThreadProc")
29         self.expect("\^done")
30
31         # Run to the breakpoint
32         self.runCmd("-exec-run")
33         self.expect("\^running")
34         self.expect("\*stopped,reason=\"breakpoint-hit\"")
35
36         self.runCmd("-thread-info")
37         self.expect(
38             "\^done,threads=\[\{id=\"1\",(.*)\},\{id=\"2\",(.*)\],current-thread-id=\"2\"")
39
40         self.runCmd("-gdb-quit")