1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
"""Test that we get thread names when interrupting a process."""
import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestInterruptThreadNames(TestBase):
@skipUnlessDarwin
def test_internal_bps_resolved(self):
self.build()
source_file = lldb.SBFileSpec("main.c")
target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
self, "initial hello", source_file
)
thread_start_func_names = [
"start_wqthread",
"_pthread_wqthread",
"_pthread_start",
]
known_module_names = [
"libsystem_c.dylib",
"libSystem.B.dylib",
"libsystem_pthread.dylib",
]
bps = []
for func in thread_start_func_names:
for module in known_module_names:
bps.append(target.BreakpointCreateByName(func, module))
num_resolved = 0
for bp in bps:
num_resolved += bp.GetNumResolvedLocations()
self.assertGreater(num_resolved, 0)
@skipUnlessDarwin
def test_internal_bps_deleted_on_relaunch(self):
self.build()
source_file = lldb.SBFileSpec("main.c")
target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
self, "initial hello", source_file
)
self.runCmd("break list --internal")
output = self.res.GetOutput()
self.assertEqual(output.count("thread-creation"), 1)
process.Kill()
self.runCmd("run", RUN_SUCCEEDED)
self.runCmd("break list --internal")
output = self.res.GetOutput()
self.assertEqual(output.count("thread-creation"), 1)
|