Lines Matching refs:self
35 def test_many_breakpoints_dwarf(self): argument
37 self.buildDwarf(dictionary=self.getBuildFlags())
38 self.do_thread_actions(num_breakpoint_threads=100)
43 def test_many_watchpoints_dwarf(self): argument
45 self.buildDwarf(dictionary=self.getBuildFlags())
46 self.do_thread_actions(num_watchpoint_threads=100)
50 def test_many_signals_dwarf(self): argument
52 self.buildDwarf(dictionary=self.getBuildFlags())
53 self.do_thread_actions(num_signal_threads=100)
57 def test_many_crash_dwarf(self): argument
59 self.buildDwarf(dictionary=self.getBuildFlags())
60 self.do_thread_actions(num_crash_threads=100)
68 def test_signal_break_dwarf(self): argument
70 self.buildDwarf(dictionary=self.getBuildFlags())
71 self.do_thread_actions(num_breakpoint_threads=1, num_signal_threads=1)
75 def test_delay_signal_break_dwarf(self): argument
77 self.buildDwarf(dictionary=self.getBuildFlags())
78 self.do_thread_actions(num_breakpoint_threads=1, num_delay_signal_threads=1)
82 def test_signal_delay_break_dwarf(self): argument
84 self.buildDwarf(dictionary=self.getBuildFlags())
85 self.do_thread_actions(num_delay_breakpoint_threads=1, num_signal_threads=1)
93 def test_watch_break_dwarf(self): argument
95 self.buildDwarf(dictionary=self.getBuildFlags())
96 self.do_thread_actions(num_breakpoint_threads=1, num_watchpoint_threads=1)
101 def test_delay_watch_break_dwarf(self): argument
103 self.buildDwarf(dictionary=self.getBuildFlags())
104 self.do_thread_actions(num_breakpoint_threads=1, num_delay_watchpoint_threads=1)
109 def test_watch_break_dwarf(self): argument
111 self.buildDwarf(dictionary=self.getBuildFlags())
112 self.do_thread_actions(num_delay_breakpoint_threads=1, num_watchpoint_threads=1)
120 def test_signal_watch_dwarf(self): argument
122 self.buildDwarf(dictionary=self.getBuildFlags())
123 self.do_thread_actions(num_signal_threads=1, num_watchpoint_threads=1)
128 def test_delay_signal_watch_dwarf(self): argument
130 self.buildDwarf(dictionary=self.getBuildFlags())
131 self.do_thread_actions(num_delay_signal_threads=1, num_watchpoint_threads=1)
136 def test_signal_delay_watch_dwarf(self): argument
138 self.buildDwarf(dictionary=self.getBuildFlags())
139 self.do_thread_actions(num_signal_threads=1, num_delay_watchpoint_threads=1)
147 def test_two_breakpoint_threads_dwarf(self): argument
149 self.buildDwarf(dictionary=self.getBuildFlags())
150 self.do_thread_actions(num_breakpoint_threads=2)
154 def test_breakpoint_one_delay_breakpoint_threads_dwarf(self): argument
156 self.buildDwarf(dictionary=self.getBuildFlags())
157 self.do_thread_actions(num_breakpoint_threads=1,
162 def test_two_breakpoints_one_signal_dwarf(self): argument
164 self.buildDwarf(dictionary=self.getBuildFlags())
165 self.do_thread_actions(num_breakpoint_threads=2, num_signal_threads=1)
169 def test_breakpoint_delay_breakpoint_one_signal_dwarf(self): argument
171 self.buildDwarf(dictionary=self.getBuildFlags())
172 self.do_thread_actions(num_breakpoint_threads=1,
178 def test_two_breakpoints_one_delay_signal_dwarf(self): argument
180 self.buildDwarf(dictionary=self.getBuildFlags())
181 self.do_thread_actions(num_breakpoint_threads=2, num_delay_signal_threads=1)
186 def test_two_breakpoints_one_watchpoint_dwarf(self): argument
188 self.buildDwarf(dictionary=self.getBuildFlags())
189 self.do_thread_actions(num_breakpoint_threads=2, num_watchpoint_threads=1)
194 def test_breakpoints_delayed_breakpoint_one_watchpoint_dwarf(self): argument
196 self.buildDwarf(dictionary=self.getBuildFlags())
197 self.do_thread_actions(num_breakpoint_threads=1,
207 def test_two_watchpoint_threads_dwarf(self): argument
209 self.buildDwarf(dictionary=self.getBuildFlags())
210 self.do_thread_actions(num_watchpoint_threads=2)
215 def test_watchpoint_with_delay_waychpoint_threads_dwarf(self): argument
217 self.buildDwarf(dictionary=self.getBuildFlags())
218 self.do_thread_actions(num_watchpoint_threads=1,
224 def test_two_watchpoints_one_breakpoint_dwarf(self): argument
226 self.buildDwarf(dictionary=self.getBuildFlags())
227 self.do_thread_actions(num_watchpoint_threads=2, num_breakpoint_threads=1)
232 def test_two_watchpoints_one_delay_breakpoint_dwarf(self): argument
234 self.buildDwarf(dictionary=self.getBuildFlags())
235 self.do_thread_actions(num_watchpoint_threads=2, num_delay_breakpoint_threads=1)
240 def test_watchpoint_delay_watchpoint_one_breakpoint_dwarf(self): argument
242 self.buildDwarf(dictionary=self.getBuildFlags())
243 self.do_thread_actions(num_watchpoint_threads=1,
250 def test_two_watchpoints_one_signal_dwarf(self): argument
252 self.buildDwarf(dictionary=self.getBuildFlags())
253 self.do_thread_actions(num_watchpoint_threads=2, num_signal_threads=1)
260 def test_signal_watch_break_dwarf(self): argument
262 self.buildDwarf(dictionary=self.getBuildFlags())
263 self.do_thread_actions(num_signal_threads=1,
269 def test_signal_watch_break_dwarf(self): argument
271 self.buildDwarf(dictionary=self.getBuildFlags())
272 self.do_thread_actions(num_signal_threads=1,
279 def test_signal_watch_break_dwarf(self): argument
281 self.buildDwarf(dictionary=self.getBuildFlags())
282 self.do_thread_actions(num_watchpoint_threads=5,
291 def test_crash_with_break_dwarf(self): argument
293 self.buildDwarf(dictionary=self.getBuildFlags())
294 self.do_thread_actions(num_crash_threads=1, num_breakpoint_threads=1)
299 def test_crash_with_watchpoint_dwarf(self): argument
301 self.buildDwarf(dictionary=self.getBuildFlags())
302 self.do_thread_actions(num_crash_threads=1, num_watchpoint_threads=1)
306 def test_crash_with_signal_dwarf(self): argument
308 self.buildDwarf(dictionary=self.getBuildFlags())
309 self.do_thread_actions(num_crash_threads=1, num_signal_threads=1)
314 def test_crash_with_watchpoint_breakpoint_signal_dwarf(self): argument
316 self.buildDwarf(dictionary=self.getBuildFlags())
317 self.do_thread_actions(num_crash_threads=1,
325 def test_delayed_crash_with_breakpoint_watchpoint_dwarf(self): argument
327 self.buildDwarf(dictionary=self.getBuildFlags())
328 self.do_thread_actions(num_delay_crash_threads=1,
334 def test_delayed_crash_with_breakpoint_signal_dwarf(self): argument
336 self.buildDwarf(dictionary=self.getBuildFlags())
337 self.do_thread_actions(num_delay_crash_threads=1,
341 def setUp(self): argument
343 TestBase.setUp(self)
345 self.filename = 'main.cpp'
346 self.thread_breakpoint_line = line_number(self.filename, '// Set breakpoint here')
347 self.setup_breakpoint_line = line_number(self.filename, '// Break here and adjust num')
348 …self.finish_breakpoint_line = line_number(self.filename, '// Break here and verify one thread is a…
350 def describe_threads(self): argument
352 for x in self.inferior_process:
359 bp = self.inferior_target.FindBreakpointByID(bpid)
363 watch = self.inferior_target.FindWatchpointByID(watchid)
372 def add_breakpoint(self, line, descriptions): argument
377 …bpno = lldbutil.run_break_set_by_file_and_line(self, self.filename, line, num_expected_locations=-…
378 bp = self.inferior_target.FindBreakpointByID(bpno)
379 descriptions.append(": file = 'main.cpp', line = %d" % self.finish_breakpoint_line)
382 def inferior_done(self): argument
386 return self.finish_breakpoint.GetHitCount() > 0 or \
387 self.crash_count > 0 or \
388 self.inferior_process.GetState == lldb.eStateExited
390 def do_thread_actions(self, argument
406 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
409 self.inferior_target = self.dbg.GetSelectedTarget()
414 self.setup_breakpoint = self.add_breakpoint(self.setup_breakpoint_line, expected_bps)
415 self.finish_breakpoint = self.add_breakpoint(self.finish_breakpoint_line, expected_bps)
419 self.thread_breakpoint = self.add_breakpoint(self.thread_breakpoint_line, expected_bps)
422 … self.expect("breakpoint list -f", "Breakpoint locations shown correctly", substrs = expected_bps)
425 self.runCmd("run", RUN_SUCCEEDED)
428 self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT,
433 self.runCmd("watchpoint set variable g_watchme")
434 for w in self.inferior_target.watchpoint_iter():
435 self.thread_watchpoint = w
436 …self.assertTrue("g_watchme" in str(self.thread_watchpoint), "Watchpoint location not shown correct…
439 self.inferior_process = self.inferior_target.GetProcess()
443 …self.assertEqual(self.inferior_process.GetNumThreads(), 1, 'Expected to stop before any additional…
445 self.runCmd("expr num_breakpoint_threads=%d" % num_breakpoint_threads)
446 self.runCmd("expr num_crash_threads=%d" % num_crash_threads)
447 self.runCmd("expr num_signal_threads=%d" % num_signal_threads)
448 self.runCmd("expr num_watchpoint_threads=%d" % num_watchpoint_threads)
450 self.runCmd("expr num_delay_breakpoint_threads=%d" % num_delay_breakpoint_threads)
451 self.runCmd("expr num_delay_crash_threads=%d" % num_delay_crash_threads)
452 self.runCmd("expr num_delay_signal_threads=%d" % num_delay_signal_threads)
453 self.runCmd("expr num_delay_watchpoint_threads=%d" % num_delay_watchpoint_threads)
456 self.runCmd("continue")
460 num_threads = self.inferior_process.GetNumThreads()
465 self.assertEqual(num_threads, expected_num_threads,
468 … "\n\t".join(self.describe_threads())))
470 …self.signal_count = len(lldbutil.get_stopped_threads(self.inferior_process, lldb.eStopReasonSignal…
471 …self.crash_count = len(lldbutil.get_stopped_threads(self.inferior_process, lldb.eStopReasonExcepti…
474 while not self.inferior_done():
475 if self.TraceOn():
476 self.runCmd("thread backtrace all")
477 self.runCmd("continue")
478 …self.signal_count += len(lldbutil.get_stopped_threads(self.inferior_process, lldb.eStopReasonSigna…
479 …self.crash_count += len(lldbutil.get_stopped_threads(self.inferior_process, lldb.eStopReasonExcept…
483 self.assertTrue(self.crash_count > 0,
484 … "Expecting at least one thread to crash. Details: %s" % "\t\n".join(self.describe_threads()))
487 self.runCmd("process kill")
491 …self.assertEqual(1, self.finish_breakpoint.GetHitCount(), "Expected main thread (finish) breakpoin…
493 num_threads = self.inferior_process.GetNumThreads()
494 … self.assertEqual(1, num_threads, "Expecting 1 thread but seeing %d. Details:%s" % (num_threads,
495 … "\n\t".join(self.describe_threads())))
496 self.runCmd("continue")
499 self.assertEqual(0, self.crash_count, "Unexpected thread(s) in crashed state")
500 self.assertTrue(self.inferior_process.GetState() == lldb.eStateExited, PROCESS_EXITED)
504 …breakpoint_hit_count = self.thread_breakpoint.GetHitCount() if expected_breakpoint_threads > 0 els…
505 self.assertEqual(expected_breakpoint_threads, breakpoint_hit_count,
509 self.assertEqual(expected_signal_threads, self.signal_count,
510 …pected %d stops due to signal delivery, but got %d" % (expected_signal_threads, self.signal_count))
513 …watchpoint_hit_count = self.thread_watchpoint.GetHitCount() if expected_watchpoint_threads > 0 els…
514 self.assertEqual(expected_watchpoint_threads, watchpoint_hit_count,