diff options
author | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
---|---|---|
committer | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
commit | b9c1b51e45b845debb76d8658edabca70ca56079 (patch) | |
tree | dfcb5a13ef2b014202340f47036da383eaee74aa /lldb/packages/Python/lldbsuite/test/functionalities/thread | |
parent | d5aa73376966339caad04013510626ec2e42c760 (diff) | |
download | bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip |
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has
*** two obvious implications:
Firstly, merging this particular commit into a downstream fork may be a huge
effort. Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit. The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):
find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;
The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.
Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit. There are alternatives available that will attempt
to look through this change and find the appropriate prior commit. YMMV.
llvm-svn: 280751
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/thread')
50 files changed, 865 insertions, 472 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/TestNumThreads.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/TestNumThreads.py index 8184ddcfbf4..094c8670596 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/TestNumThreads.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/TestNumThreads.py @@ -5,12 +5,13 @@ Test number of threads. from __future__ import print_function - -import os, time +import os +import time import lldb from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil + class NumberOfThreadsTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -28,18 +29,23 @@ class NumberOfThreadsTestCase(TestBase): self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) # This should create a breakpoint with 1 location. - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.line, num_expected_locations=1) # The breakpoint list should show 3 locations. - self.expect("breakpoint list -f", "Breakpoint location shown correctly", - substrs = ["1: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" % self.line]) + self.expect( + "breakpoint list -f", + "Breakpoint location shown correctly", + substrs=[ + "1: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" % + self.line]) # Run the program. self.runCmd("run", RUN_SUCCEEDED) # Stopped once. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, - substrs = ["stop reason = breakpoint 1."]) + substrs=["stop reason = breakpoint 1."]) # Get the target process target = self.dbg.GetSelectedTarget() @@ -50,4 +56,6 @@ class NumberOfThreadsTestCase(TestBase): # Using std::thread may involve extra threads, so we assert that there are # at least 4 rather than exactly 4. - self.assertTrue(num_threads >= 4, 'Number of expected threads and actual threads do not match.') + self.assertTrue( + num_threads >= 4, + 'Number of expected threads and actual threads do not match.') diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py index 902adacb2ab..ba5094f6de3 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py @@ -2,13 +2,15 @@ Test regression for Bug 25251. """ -import os, time +import os +import time import unittest2 import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class BreakpointAfterJoinTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -17,11 +19,13 @@ class BreakpointAfterJoinTestCase(TestBase): # Call super's setUp(). TestBase.setUp(self) # Find the line number for our breakpoint. - self.breakpoint = line_number('ParallelTask.cpp', '// Set breakpoint here') - - @skipIfTargetAndroid(archs=["arm"]) # The android-arm compiler can't compile the inferior - # because of an issue around std::future. - # TODO: Change the test to don't depend on std::future<T> + self.breakpoint = line_number( + 'ParallelTask.cpp', '// Set breakpoint here') + + # The android-arm compiler can't compile the inferior + @skipIfTargetAndroid(archs=["arm"]) + # because of an issue around std::future. + # TODO: Change the test to don't depend on std::future<T> def test(self): """Test breakpoint handling after a thread join.""" self.build(dictionary=self.getBuildFlags()) @@ -30,23 +34,28 @@ class BreakpointAfterJoinTestCase(TestBase): self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) # This should create a breakpoint - lldbutil.run_break_set_by_file_and_line (self, "ParallelTask.cpp", self.breakpoint, num_expected_locations=-1) + lldbutil.run_break_set_by_file_and_line( + self, "ParallelTask.cpp", self.breakpoint, num_expected_locations=-1) # The breakpoint list should show 1 location. - self.expect("breakpoint list -f", "Breakpoint location shown correctly", - substrs = ["1: file = 'ParallelTask.cpp', line = %d, exact_match = 0" % self.breakpoint]) + self.expect( + "breakpoint list -f", + "Breakpoint location shown correctly", + substrs=[ + "1: file = 'ParallelTask.cpp', line = %d, exact_match = 0" % + self.breakpoint]) # Run the program. self.runCmd("run", RUN_SUCCEEDED) # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, - substrs = ['stopped', - 'stop reason = breakpoint']) + substrs=['stopped', + 'stop reason = breakpoint']) # This should not result in a segmentation fault self.expect("thread backtrace all", STOPPED_DUE_TO_BREAKPOINT, - substrs = ["stop reason = breakpoint 1."]) + substrs=["stop reason = breakpoint 1."]) # Run to completion self.runCmd("continue") diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py index 8ef0fb0a000..34634c37a7f 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py @@ -5,13 +5,14 @@ Test number of threads. from __future__ import print_function - -import os, time +import os +import time import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class BreakpointAfterJoinTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -22,9 +23,15 @@ class BreakpointAfterJoinTestCase(TestBase): # Find the line number for our breakpoint. self.breakpoint = line_number('main.cpp', '// Set breakpoint here') - @expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr15824 thread states not properly maintained") - @expectedFailureAll(oslist=lldbplatformutil.getDarwinOSTriples(), bugnumber="llvm.org/pr15824 thread states not properly maintained") - @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr18190 thread states not properly maintained") + @expectedFailureAll( + oslist=["linux"], + bugnumber="llvm.org/pr15824 thread states not properly maintained") + @expectedFailureAll( + oslist=lldbplatformutil.getDarwinOSTriples(), + bugnumber="llvm.org/pr15824 thread states not properly maintained") + @expectedFailureAll( + oslist=["freebsd"], + bugnumber="llvm.org/pr18190 thread states not properly maintained") def test(self): """Test breakpoint handling after a thread join.""" self.build(dictionary=self.getBuildFlags()) @@ -33,19 +40,24 @@ class BreakpointAfterJoinTestCase(TestBase): self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) # This should create a breakpoint in the main thread. - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.breakpoint, num_expected_locations=1) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.breakpoint, num_expected_locations=1) # The breakpoint list should show 1 location. - self.expect("breakpoint list -f", "Breakpoint location shown correctly", - substrs = ["1: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" % self.breakpoint]) + self.expect( + "breakpoint list -f", + "Breakpoint location shown correctly", + substrs=[ + "1: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" % + self.breakpoint]) # Run the program. self.runCmd("run", RUN_SUCCEEDED) # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, - substrs = ['stopped', - 'stop reason = breakpoint']) + substrs=['stopped', + 'stop reason = breakpoint']) # Get the target process target = self.dbg.GetSelectedTarget() @@ -59,12 +71,15 @@ class BreakpointAfterJoinTestCase(TestBase): num_threads = process.GetNumThreads() # Make sure we see at least six threads - self.assertTrue(num_threads >= 6, 'Number of expected threads and actual threads do not match.') + self.assertTrue( + num_threads >= 6, + 'Number of expected threads and actual threads do not match.') # Make sure all threads are stopped for i in range(0, num_threads): - self.assertTrue(process.GetThreadAtIndex(i).IsStopped(), - "Thread {0} didn't stop during breakpoint.".format(i)) + self.assertTrue( + process.GetThreadAtIndex(i).IsStopped(), + "Thread {0} didn't stop during breakpoint.".format(i)) # Run to completion self.runCmd("continue") @@ -75,4 +90,6 @@ class BreakpointAfterJoinTestCase(TestBase): self.runCmd("process status") # At this point, the inferior process should have exited. - self.assertTrue(process.GetState() == lldb.eStateExited, PROCESS_EXITED) + self.assertTrue( + process.GetState() == lldb.eStateExited, + PROCESS_EXITED) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_delay_breakpoint_one_signal/TestConcurrentBreakpointDelayBreakpointOneSignal.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_delay_breakpoint_one_signal/TestConcurrentBreakpointDelayBreakpointOneSignal.py index bafff4c63f0..d470e1a46bd 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_delay_breakpoint_one_signal/TestConcurrentBreakpointDelayBreakpointOneSignal.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_delay_breakpoint_one_signal/TestConcurrentBreakpointDelayBreakpointOneSignal.py @@ -12,13 +12,12 @@ class ConcurrentBreakpointDelayBreakpointOneSignal(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + @skipIfFreeBSD # timing out on buildbot + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_breakpoint_delay_breakpoint_one_signal(self): """Test two threads that trigger a breakpoint (one with a 1 second delay) and one signal thread. """ self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_breakpoint_threads=1, num_delay_breakpoint_threads=1, num_signal_threads=1) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_one_delay_breakpoint_threads/TestConcurrentBreakpointOneDelayBreakpointThreads.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_one_delay_breakpoint_threads/TestConcurrentBreakpointOneDelayBreakpointThreads.py index 5d31f9a402f..5b88f7e38c8 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_one_delay_breakpoint_threads/TestConcurrentBreakpointOneDelayBreakpointThreads.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_one_delay_breakpoint_threads/TestConcurrentBreakpointOneDelayBreakpointThreads.py @@ -12,12 +12,11 @@ class ConcurrentBreakpointOneDelayBreakpointThreads(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + @skipIfFreeBSD # timing out on buildbot + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_breakpoint_one_delay_breakpoint_threads(self): """Test threads that trigger a breakpoint where one thread has a 1 second delay. """ self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_breakpoint_threads=1, num_delay_breakpoint_threads=1) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py index 8cba670d6b9..b48ff4bf04a 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py @@ -8,18 +8,18 @@ from lldbsuite.test.lldbtest import TestBase @skipIfWindows -class ConcurrentBreakpointsDelayedBreakpointOneWatchpoint(ConcurrentEventsBase): +class ConcurrentBreakpointsDelayedBreakpointOneWatchpoint( + ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_breakpoints_delayed_breakpoint_one_watchpoint(self): """Test a breakpoint, a delayed breakpoint, and one watchpoint thread. """ self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_breakpoint_threads=1, num_delay_breakpoint_threads=1, num_watchpoint_threads=1) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_break/TestConcurrentCrashWithBreak.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_break/TestConcurrentCrashWithBreak.py index a24399347ae..827a5dcd343 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_break/TestConcurrentCrashWithBreak.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_break/TestConcurrentCrashWithBreak.py @@ -12,11 +12,10 @@ class ConcurrentCrashWithBreak(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + @skipIfFreeBSD # timing out on buildbot + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_crash_with_break(self): """ Test a thread that crashes while another thread hits a breakpoint.""" self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_crash_threads=1, num_breakpoint_threads=1) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_signal/TestConcurrentCrashWithSignal.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_signal/TestConcurrentCrashWithSignal.py index a6da4a8b001..4d9d758f323 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_signal/TestConcurrentCrashWithSignal.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_signal/TestConcurrentCrashWithSignal.py @@ -12,11 +12,10 @@ class ConcurrentCrashWithSignal(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + @skipIfFreeBSD # timing out on buildbot + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_crash_with_signal(self): """ Test a thread that crashes while another thread generates a signal.""" self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_crash_threads=1, num_signal_threads=1) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint/TestConcurrentCrashWithWatchpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint/TestConcurrentCrashWithWatchpoint.py index 9c45f9592e8..db7b40ea454 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint/TestConcurrentCrashWithWatchpoint.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint/TestConcurrentCrashWithWatchpoint.py @@ -12,12 +12,11 @@ class ConcurrentCrashWithWatchpoint(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_crash_with_watchpoint(self): """ Test a thread that crashes while another thread hits a watchpoint.""" self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_crash_threads=1, num_watchpoint_threads=1) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint_breakpoint_signal/TestConcurrentCrashWithWatchpointBreakpointSignal.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint_breakpoint_signal/TestConcurrentCrashWithWatchpointBreakpointSignal.py index 093eb156297..44faf408760 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint_breakpoint_signal/TestConcurrentCrashWithWatchpointBreakpointSignal.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint_breakpoint_signal/TestConcurrentCrashWithWatchpointBreakpointSignal.py @@ -12,9 +12,10 @@ class ConcurrentCrashWithWatchpointBreakpointSignal(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_crash_with_watchpoint_breakpoint_signal(self): """ Test a thread that crashes while other threads generate a signal and hit a watchpoint and breakpoint. """ self.build(dictionary=self.getBuildFlags()) @@ -22,5 +23,3 @@ class ConcurrentCrashWithWatchpointBreakpointSignal(ConcurrentEventsBase): num_breakpoint_threads=1, num_signal_threads=1, num_watchpoint_threads=1) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_break/TestConcurrentDelaySignalBreak.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_break/TestConcurrentDelaySignalBreak.py index 37d8f24de0d..5f69e5615eb 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_break/TestConcurrentDelaySignalBreak.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_break/TestConcurrentDelaySignalBreak.py @@ -12,11 +12,12 @@ class ConcurrentDelaySignalBreak(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + @skipIfFreeBSD # timing out on buildbot + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_delay_signal_break(self): """Test (1-second delay) signal and a breakpoint in multiple threads.""" self.build(dictionary=self.getBuildFlags()) - self.do_thread_actions(num_breakpoint_threads=1, num_delay_signal_threads=1) - - + self.do_thread_actions( + num_breakpoint_threads=1, + num_delay_signal_threads=1) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_watch/TestConcurrentDelaySignalWatch.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_watch/TestConcurrentDelaySignalWatch.py index 1d52d6a6df9..0118f584c1b 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_watch/TestConcurrentDelaySignalWatch.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_watch/TestConcurrentDelaySignalWatch.py @@ -12,12 +12,13 @@ class ConcurrentDelaySignalWatch(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_delay_signal_watch(self): """Test a watchpoint and a (1 second delay) signal in multiple threads.""" self.build(dictionary=self.getBuildFlags()) - self.do_thread_actions(num_delay_signal_threads=1, num_watchpoint_threads=1) - - + self.do_thread_actions( + num_delay_signal_threads=1, + num_watchpoint_threads=1) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_watch_break/TestConcurrentDelayWatchBreak.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_watch_break/TestConcurrentDelayWatchBreak.py index 9f7b91c7fa4..79d04d1ca63 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_watch_break/TestConcurrentDelayWatchBreak.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_watch_break/TestConcurrentDelayWatchBreak.py @@ -12,12 +12,13 @@ class ConcurrentDelayWatchBreak(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_delay_watch_break(self): """Test (1-second delay) watchpoint and a breakpoint in multiple threads.""" self.build(dictionary=self.getBuildFlags()) - self.do_thread_actions(num_breakpoint_threads=1, num_delay_watchpoint_threads=1) - - + self.do_thread_actions( + num_breakpoint_threads=1, + num_delay_watchpoint_threads=1) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_signal/TestConcurrentDelayedCrashWithBreakpointSignal.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_signal/TestConcurrentDelayedCrashWithBreakpointSignal.py index 0d36ce663db..8018ee30748 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_signal/TestConcurrentDelayedCrashWithBreakpointSignal.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_signal/TestConcurrentDelayedCrashWithBreakpointSignal.py @@ -12,13 +12,12 @@ class ConcurrentDelayedCrashWithBreakpointSignal(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + @skipIfFreeBSD # timing out on buildbot + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_delayed_crash_with_breakpoint_signal(self): """ Test a thread with a delayed crash while other threads generate a signal and hit a breakpoint. """ self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_delay_crash_threads=1, num_breakpoint_threads=1, num_signal_threads=1) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_watchpoint/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_watchpoint/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py index 2397c4117f0..552e9424bad 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_watchpoint/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_watchpoint/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py @@ -12,14 +12,13 @@ class ConcurrentDelayedCrashWithBreakpointWatchpoint(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_delayed_crash_with_breakpoint_watchpoint(self): """ Test a thread with a delayed crash while other threads hit a watchpoint and a breakpoint. """ self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_delay_crash_threads=1, num_breakpoint_threads=1, num_watchpoint_threads=1) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_breakpoints/TestConcurrentManyBreakpoints.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_breakpoints/TestConcurrentManyBreakpoints.py index af55e0b067b..3f221b19752 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_breakpoints/TestConcurrentManyBreakpoints.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_breakpoints/TestConcurrentManyBreakpoints.py @@ -12,11 +12,12 @@ class ConcurrentManyBreakpoints(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @unittest2.skipIf(TestBase.skipLongRunningTest(), "Skip this long running test") - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + @unittest2.skipIf( + TestBase.skipLongRunningTest(), + "Skip this long running test") + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_many_breakpoints(self): """Test 100 breakpoints from 100 threads.""" self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_breakpoint_threads=100) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_crash/TestConcurrentManyCrash.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_crash/TestConcurrentManyCrash.py index 89b494d489b..a6c4a0082f3 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_crash/TestConcurrentManyCrash.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_crash/TestConcurrentManyCrash.py @@ -12,12 +12,12 @@ class ConcurrentManyCrash(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @unittest2.skipIf(TestBase.skipLongRunningTest(), "Skip this long running test") - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + @unittest2.skipIf( + TestBase.skipLongRunningTest(), + "Skip this long running test") + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_many_crash(self): """Test 100 threads that cause a segfault.""" self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_crash_threads=100) - - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_signals/TestConcurrentManySignals.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_signals/TestConcurrentManySignals.py index 1c07a12de60..5dcf52178b7 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_signals/TestConcurrentManySignals.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_signals/TestConcurrentManySignals.py @@ -12,11 +12,12 @@ class ConcurrentManySignals(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @unittest2.skipIf(TestBase.skipLongRunningTest(), "Skip this long running test") - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + @unittest2.skipIf( + TestBase.skipLongRunningTest(), + "Skip this long running test") + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_many_signals(self): """Test 100 signals from 100 threads.""" self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_signal_threads=100) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_watchpoints/TestConcurrentManyWatchpoints.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_watchpoints/TestConcurrentManyWatchpoints.py index 48fddac5e93..9d2d0ffc2a6 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_watchpoints/TestConcurrentManyWatchpoints.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_watchpoints/TestConcurrentManyWatchpoints.py @@ -12,11 +12,12 @@ class ConcurrentManyWatchpoints(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @unittest2.skipIf(TestBase.skipLongRunningTest(), "Skip this long running test") - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + @unittest2.skipIf( + TestBase.skipLongRunningTest(), + "Skip this long running test") + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_many_watchpoints(self): """Test 100 watchpoints from 100 threads.""" self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_watchpoint_threads=100) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/n_watch_n_break/TestConcurrentNWatchNBreak.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/n_watch_n_break/TestConcurrentNWatchNBreak.py index 79926feb7cf..a538c1b5243 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/n_watch_n_break/TestConcurrentNWatchNBreak.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/n_watch_n_break/TestConcurrentNWatchNBreak.py @@ -12,14 +12,12 @@ class ConcurrentNWatchNBreak(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_n_watch_n_break(self): """Test with 5 watchpoint and breakpoint threads.""" self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_watchpoint_threads=5, num_breakpoint_threads=5) - - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_break/TestConcurrentSignalBreak.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_break/TestConcurrentSignalBreak.py index 8d863ef131d..7937126cbbf 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_break/TestConcurrentSignalBreak.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_break/TestConcurrentSignalBreak.py @@ -12,11 +12,10 @@ class ConcurrentSignalBreak(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + @skipIfFreeBSD # timing out on buildbot + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_signal_break(self): """Test signal and a breakpoint in multiple threads.""" self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_breakpoint_threads=1, num_signal_threads=1) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_break/TestConcurrentSignalDelayBreak.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_break/TestConcurrentSignalDelayBreak.py index 442b52f0311..33ebcc97520 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_break/TestConcurrentSignalDelayBreak.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_break/TestConcurrentSignalDelayBreak.py @@ -12,12 +12,12 @@ class ConcurrentSignalDelayBreak(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + @skipIfFreeBSD # timing out on buildbot + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_signal_delay_break(self): """Test signal and a (1 second delay) breakpoint in multiple threads.""" self.build(dictionary=self.getBuildFlags()) - self.do_thread_actions(num_delay_breakpoint_threads=1, num_signal_threads=1) - - - + self.do_thread_actions( + num_delay_breakpoint_threads=1, + num_signal_threads=1) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_watch/TestConcurrentSignalDelayWatch.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_watch/TestConcurrentSignalDelayWatch.py index 92d40c1fe3b..4f797730b00 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_watch/TestConcurrentSignalDelayWatch.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_watch/TestConcurrentSignalDelayWatch.py @@ -12,13 +12,13 @@ class ConcurrentSignalDelayWatch(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_signal_delay_watch(self): """Test a (1 second delay) watchpoint and a signal in multiple threads.""" self.build(dictionary=self.getBuildFlags()) - self.do_thread_actions(num_signal_threads=1, num_delay_watchpoint_threads=1) - - - + self.do_thread_actions( + num_signal_threads=1, + num_delay_watchpoint_threads=1) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_n_watch_n_break/TestConcurrentSignalNWatchNBreak.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_n_watch_n_break/TestConcurrentSignalNWatchNBreak.py index 4c3aaba2943..861273a1701 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_n_watch_n_break/TestConcurrentSignalNWatchNBreak.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_n_watch_n_break/TestConcurrentSignalNWatchNBreak.py @@ -12,14 +12,13 @@ class ConcurrentSignalNWatchNBreak(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_signal_n_watch_n_break(self): """Test one signal thread with 5 watchpoint and breakpoint threads.""" self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_signal_threads=1, num_watchpoint_threads=5, num_breakpoint_threads=5) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch/TestConcurrentSignalWatch.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch/TestConcurrentSignalWatch.py index bc019e29bd0..8aadd318e9b 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch/TestConcurrentSignalWatch.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch/TestConcurrentSignalWatch.py @@ -12,12 +12,11 @@ class ConcurrentSignalWatch(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_signal_watch(self): """Test a watchpoint and a signal in multiple threads.""" self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_signal_threads=1, num_watchpoint_threads=1) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch_break/TestConcurrentSignalWatchBreak.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch_break/TestConcurrentSignalWatchBreak.py index a0bf925f564..025e10bf931 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch_break/TestConcurrentSignalWatchBreak.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch_break/TestConcurrentSignalWatchBreak.py @@ -12,14 +12,13 @@ class ConcurrentSignalWatchBreak(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_signal_watch_break(self): """Test a signal/watchpoint/breakpoint in multiple threads.""" self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_signal_threads=1, num_watchpoint_threads=1, num_breakpoint_threads=1) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoint_threads/TestConcurrentTwoBreakpointThreads.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoint_threads/TestConcurrentTwoBreakpointThreads.py index ecd8061cca2..24012365b8d 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoint_threads/TestConcurrentTwoBreakpointThreads.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoint_threads/TestConcurrentTwoBreakpointThreads.py @@ -12,11 +12,10 @@ class ConcurrentTwoBreakpointThreads(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + @skipIfFreeBSD # timing out on buildbot + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_two_breakpoint_threads(self): """Test two threads that trigger a breakpoint. """ self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_breakpoint_threads=2) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_delay_signal/TestConcurrentTwoBreakpointsOneDelaySignal.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_delay_signal/TestConcurrentTwoBreakpointsOneDelaySignal.py index 2814cab1362..56435026253 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_delay_signal/TestConcurrentTwoBreakpointsOneDelaySignal.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_delay_signal/TestConcurrentTwoBreakpointsOneDelaySignal.py @@ -12,11 +12,12 @@ class ConcurrentTwoBreakpointsOneDelaySignal(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + @skipIfFreeBSD # timing out on buildbot + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_two_breakpoints_one_delay_signal(self): """Test two threads that trigger a breakpoint and one (1 second delay) signal thread. """ self.build(dictionary=self.getBuildFlags()) - self.do_thread_actions(num_breakpoint_threads=2, num_delay_signal_threads=1) - - + self.do_thread_actions( + num_breakpoint_threads=2, + num_delay_signal_threads=1) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_signal/TestConcurrentTwoBreakpointsOneSignal.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_signal/TestConcurrentTwoBreakpointsOneSignal.py index 2513e61fd4e..bd9f5cd4ca7 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_signal/TestConcurrentTwoBreakpointsOneSignal.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_signal/TestConcurrentTwoBreakpointsOneSignal.py @@ -12,11 +12,10 @@ class ConcurrentTwoBreakpointsOneSignal(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + @skipIfFreeBSD # timing out on buildbot + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_two_breakpoints_one_signal(self): """Test two threads that trigger a breakpoint and one signal thread. """ self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_breakpoint_threads=2, num_signal_threads=1) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_watchpoint/TestConcurrentTwoBreakpointsOneWatchpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_watchpoint/TestConcurrentTwoBreakpointsOneWatchpoint.py index c3444459109..6d2c8ef6cbc 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_watchpoint/TestConcurrentTwoBreakpointsOneWatchpoint.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_watchpoint/TestConcurrentTwoBreakpointsOneWatchpoint.py @@ -12,12 +12,13 @@ class ConcurrentTwoBreakpointsOneWatchpoint(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_two_breakpoints_one_watchpoint(self): """Test two threads that trigger a breakpoint and one watchpoint thread. """ self.build(dictionary=self.getBuildFlags()) - self.do_thread_actions(num_breakpoint_threads=2, num_watchpoint_threads=1) - - + self.do_thread_actions( + num_breakpoint_threads=2, + num_watchpoint_threads=1) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoint_threads/TestConcurrentTwoWatchpointThreads.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoint_threads/TestConcurrentTwoWatchpointThreads.py index 60b538d43cf..7742f00aeed 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoint_threads/TestConcurrentTwoWatchpointThreads.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoint_threads/TestConcurrentTwoWatchpointThreads.py @@ -12,12 +12,11 @@ class ConcurrentTwoWatchpointThreads(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_two_watchpoint_threads(self): """Test two threads that trigger a watchpoint. """ self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_watchpoint_threads=2) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_breakpoint/TestConcurrentTwoWatchpointsOneBreakpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_breakpoint/TestConcurrentTwoWatchpointsOneBreakpoint.py index 9e448d607d6..d1be67cad31 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_breakpoint/TestConcurrentTwoWatchpointsOneBreakpoint.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_breakpoint/TestConcurrentTwoWatchpointsOneBreakpoint.py @@ -12,12 +12,13 @@ class ConcurrentTwoWatchpointsOneBreakpoint(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_two_watchpoints_one_breakpoint(self): """Test two threads that trigger a watchpoint and one breakpoint thread. """ self.build(dictionary=self.getBuildFlags()) - self.do_thread_actions(num_watchpoint_threads=2, num_breakpoint_threads=1) - - + self.do_thread_actions( + num_watchpoint_threads=2, + num_breakpoint_threads=1) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_delay_breakpoint/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_delay_breakpoint/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py index 60faf1bbb3f..b1b6fbc82f2 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_delay_breakpoint/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_delay_breakpoint/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py @@ -12,12 +12,13 @@ class ConcurrentTwoWatchpointsOneDelayBreakpoint(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_two_watchpoints_one_delay_breakpoint(self): """Test two threads that trigger a watchpoint and one (1 second delay) breakpoint thread. """ self.build(dictionary=self.getBuildFlags()) - self.do_thread_actions(num_watchpoint_threads=2, num_delay_breakpoint_threads=1) - - + self.do_thread_actions( + num_watchpoint_threads=2, + num_delay_breakpoint_threads=1) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_signal/TestConcurrentTwoWatchpointsOneSignal.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_signal/TestConcurrentTwoWatchpointsOneSignal.py index 070fd64e583..39e77a2052a 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_signal/TestConcurrentTwoWatchpointsOneSignal.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_signal/TestConcurrentTwoWatchpointsOneSignal.py @@ -12,12 +12,11 @@ class ConcurrentTwoWatchpointsOneSignal(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_two_watchpoints_one_signal(self): """Test two threads that trigger a watchpoint and one signal thread. """ self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_watchpoint_threads=2, num_signal_threads=1) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break/TestConcurrentWatchBreak.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break/TestConcurrentWatchBreak.py index c678e0053cb..7537490eaa4 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break/TestConcurrentWatchBreak.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break/TestConcurrentWatchBreak.py @@ -12,12 +12,13 @@ class ConcurrentWatchBreak(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_watch_break(self): """Test watchpoint and a breakpoint in multiple threads.""" self.build(dictionary=self.getBuildFlags()) - self.do_thread_actions(num_breakpoint_threads=1, num_watchpoint_threads=1) - - + self.do_thread_actions( + num_breakpoint_threads=1, + num_watchpoint_threads=1) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break_delay/TestConcurrentWatchBreakDelay.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break_delay/TestConcurrentWatchBreakDelay.py index 909ba7a78af..d5af2ce4770 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break_delay/TestConcurrentWatchBreakDelay.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break_delay/TestConcurrentWatchBreakDelay.py @@ -12,12 +12,13 @@ class ConcurrentWatchBreakDelay(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_watch_break_delay(self): """Test watchpoint and a (1 second delay) breakpoint in multiple threads.""" self.build(dictionary=self.getBuildFlags()) - self.do_thread_actions(num_delay_breakpoint_threads=1, num_watchpoint_threads=1) - - + self.do_thread_actions( + num_delay_breakpoint_threads=1, + num_watchpoint_threads=1) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_delay_watchpoint_one_breakpoint/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_delay_watchpoint_one_breakpoint/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py index 52c55244f43..79fc70f888f 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_delay_watchpoint_one_breakpoint/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_delay_watchpoint_one_breakpoint/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py @@ -12,14 +12,13 @@ class ConcurrentWatchpointDelayWatchpointOneBreakpoint(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_watchpoint_delay_watchpoint_one_breakpoint(self): """Test two threads that trigger a watchpoint (one with a 1 second delay) and one breakpoint thread. """ self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_watchpoint_threads=1, num_delay_watchpoint_threads=1, num_breakpoint_threads=1) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_with_delay_watchpoint_threads/TestConcurrentWatchpointWithDelayWatchpointThreads.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_with_delay_watchpoint_threads/TestConcurrentWatchpointWithDelayWatchpointThreads.py index 71ebcc1e509..2b3d422c066 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_with_delay_watchpoint_threads/TestConcurrentWatchpointWithDelayWatchpointThreads.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_with_delay_watchpoint_threads/TestConcurrentWatchpointWithDelayWatchpointThreads.py @@ -12,13 +12,12 @@ class ConcurrentWatchpointWithDelayWatchpointThreads(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) - @skipIfFreeBSD # timing out on buildbot + @skipIfFreeBSD # timing out on buildbot @skipIfRemoteDueToDeadlock - @expectedFailureAll(triple = '^mips') # Atomic sequences are not supported yet for MIPS in LLDB. + # Atomic sequences are not supported yet for MIPS in LLDB. + @expectedFailureAll(triple='^mips') def test_watchpoint_with_delay_watchpoint_threads(self): """Test two threads that trigger a watchpoint where one thread has a 1 second delay. """ self.build(dictionary=self.getBuildFlags()) self.do_thread_actions(num_watchpoint_threads=1, num_delay_watchpoint_threads=1) - - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py index edd1e885ca9..a9a8aa31e37 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py @@ -5,13 +5,13 @@ Test that step-inst over a crash behaves correctly. from __future__ import print_function - import os import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class CreateDuringStepTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -22,8 +22,12 @@ class CreateDuringStepTestCase(TestBase): @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778") @expectedFailureAndroid("llvm.org/pr24497", archs=['arm', 'aarch64']) - @expectedFailureAll(oslist=["linux"], archs=["arm"], bugnumber="llvm.org/pr24497") - @expectedFailureAll(triple = re.compile('^mips')) # IO error due to breakpoint at invalid address + @expectedFailureAll( + oslist=["linux"], + archs=["arm"], + bugnumber="llvm.org/pr24497") + # IO error due to breakpoint at invalid address + @expectedFailureAll(triple=re.compile('^mips')) def test_step_inst_with(self): """Test thread creation during step-inst handling.""" self.build(dictionary=self.getBuildFlags()) @@ -32,21 +36,34 @@ class CreateDuringStepTestCase(TestBase): target = self.dbg.CreateTarget(exe) self.assertTrue(target and target.IsValid(), "Target is valid") - self.bp_num = lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.breakpoint, num_expected_locations=1) + self.bp_num = lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.breakpoint, num_expected_locations=1) # Run the program. - process = target.LaunchSimple(None, None, self.get_process_working_directory()) + process = target.LaunchSimple( + None, None, self.get_process_working_directory()) self.assertTrue(process and process.IsValid(), PROCESS_IS_VALID) # The stop reason should be breakpoint. - self.assertEqual(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED) - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) + self.assertEqual( + process.GetState(), + lldb.eStateStopped, + PROCESS_STOPPED) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonBreakpoint) self.assertTrue(thread.IsValid(), STOPPED_DUE_TO_BREAKPOINT) # Keep stepping until the inferior crashes while process.GetState() == lldb.eStateStopped and not lldbutil.is_thread_crashed(self, thread): thread.StepInstruction(False) - self.assertEqual(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED) - self.assertTrue(lldbutil.is_thread_crashed(self, thread), "Thread has crashed") + self.assertEqual( + process.GetState(), + lldb.eStateStopped, + PROCESS_STOPPED) + self.assertTrue( + lldbutil.is_thread_crashed( + self, + thread), + "Thread has crashed") process.Kill() diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py index 1cb97355395..fb6208a0d3e 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py @@ -5,31 +5,33 @@ Test thread creation after process attach. from __future__ import print_function - -import os, time +import os +import time import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class CreateAfterAttachTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @skipIfFreeBSD # Hangs. May be the same as Linux issue llvm.org/pr16229 but - # not yet investigated. Revisit once required functionality - # is implemented for FreeBSD. - @skipIfWindows # Occasionally hangs on Windows, may be same as other issues. + @skipIfFreeBSD # Hangs. May be the same as Linux issue llvm.org/pr16229 but + # not yet investigated. Revisit once required functionality + # is implemented for FreeBSD. + # Occasionally hangs on Windows, may be same as other issues. + @skipIfWindows @skipIfiOSSimulator def test_create_after_attach_with_popen(self): """Test thread creation after process attach.""" self.build(dictionary=self.getBuildFlags(use_cpp11=False)) self.create_after_attach(use_fork=False) - @skipIfFreeBSD # Hangs. Revisit once required functionality is implemented - # for FreeBSD. + @skipIfFreeBSD # Hangs. Revisit once required functionality is implemented + # for FreeBSD. @skipIfRemote - @skipIfWindows # Windows doesn't have fork. + @skipIfWindows # Windows doesn't have fork. @skipIfiOSSimulator def test_create_after_attach_with_fork(self): """Test thread creation after process attach.""" @@ -66,13 +68,16 @@ class CreateAfterAttachTestCase(TestBase): self.assertTrue(process, PROCESS_IS_VALID) # This should create a breakpoint in the main thread. - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_1, num_expected_locations=1) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.break_1, num_expected_locations=1) # This should create a breakpoint in the second child thread. - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_2, num_expected_locations=1) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.break_2, num_expected_locations=1) # This should create a breakpoint in the first child thread. - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_3, num_expected_locations=1) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.break_3, num_expected_locations=1) # Note: With std::thread, we cannot rely on particular thread numbers. Using # std::thread may cause the program to spin up a thread pool (and it does on @@ -83,10 +88,10 @@ class CreateAfterAttachTestCase(TestBase): # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, - substrs = ['stopped', - '* thread #', - 'main', - 'stop reason = breakpoint']) + substrs=['stopped', + '* thread #', + 'main', + 'stop reason = breakpoint']) # Change a variable to escape the loop self.runCmd("expression main_thread_continue = 1") @@ -96,10 +101,10 @@ class CreateAfterAttachTestCase(TestBase): # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, - substrs = ['stopped', - '* thread #', - 'thread_2_func', - 'stop reason = breakpoint']) + substrs=['stopped', + '* thread #', + 'thread_2_func', + 'stop reason = breakpoint']) # Change a variable to escape the loop self.runCmd("expression child_thread_continue = 1") @@ -110,13 +115,15 @@ class CreateAfterAttachTestCase(TestBase): # The stop reason of the thread should be breakpoint. # Thread 3 may or may not have already exited. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, - substrs = ['stopped', - '* thread #', - 'thread_1_func', - 'stop reason = breakpoint']) + substrs=['stopped', + '* thread #', + 'thread_1_func', + 'stop reason = breakpoint']) # Run to completion self.runCmd("continue") # At this point, the inferior process should have exited. - self.assertTrue(process.GetState() == lldb.eStateExited, PROCESS_EXITED) + self.assertTrue( + process.GetState() == lldb.eStateExited, + PROCESS_EXITED) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py index 9401826e304..02f6a1aca41 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py @@ -5,43 +5,74 @@ Test number of threads. from __future__ import print_function - -import os, time +import os +import time import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class CreateDuringStepTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr15824 thread states not properly maintained") - @expectedFailureAll(oslist=lldbplatformutil.getDarwinOSTriples(), bugnumber="llvm.org/pr15824 thread states not properly maintained") - @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr18190 thread states not properly maintained") - @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly") + @expectedFailureAll( + oslist=["linux"], + bugnumber="llvm.org/pr15824 thread states not properly maintained") + @expectedFailureAll( + oslist=lldbplatformutil.getDarwinOSTriples(), + bugnumber="llvm.org/pr15824 thread states not properly maintained") + @expectedFailureAll( + oslist=["freebsd"], + bugnumber="llvm.org/pr18190 thread states not properly maintained") + @expectedFailureAll( + oslist=["windows"], + bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly") def test_step_inst(self): """Test thread creation during step-inst handling.""" self.build(dictionary=self.getBuildFlags()) - self.create_during_step_base("thread step-inst -m all-threads", 'stop reason = instruction step') - - @expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr15824 thread states not properly maintained") - @expectedFailureAll(oslist=lldbplatformutil.getDarwinOSTriples(), bugnumber="llvm.org/pr15824 thread states not properly maintained") - @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr18190 thread states not properly maintained") - @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly") + self.create_during_step_base( + "thread step-inst -m all-threads", + 'stop reason = instruction step') + + @expectedFailureAll( + oslist=["linux"], + bugnumber="llvm.org/pr15824 thread states not properly maintained") + @expectedFailureAll( + oslist=lldbplatformutil.getDarwinOSTriples(), + bugnumber="llvm.org/pr15824 thread states not properly maintained") + @expectedFailureAll( + oslist=["freebsd"], + bugnumber="llvm.org/pr18190 thread states not properly maintained") + @expectedFailureAll( + oslist=["windows"], + bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly") def test_step_over(self): """Test thread creation during step-over handling.""" self.build(dictionary=self.getBuildFlags()) - self.create_during_step_base("thread step-over -m all-threads", 'stop reason = step over') - - @expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr15824 thread states not properly maintained") - @expectedFailureAll(oslist=lldbplatformutil.getDarwinOSTriples(), bugnumber="llvm.org/pr15824 thread states not properly maintained") - @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr18190 thread states not properly maintained") - @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly") + self.create_during_step_base( + "thread step-over -m all-threads", + 'stop reason = step over') + + @expectedFailureAll( + oslist=["linux"], + bugnumber="llvm.org/pr15824 thread states not properly maintained") + @expectedFailureAll( + oslist=lldbplatformutil.getDarwinOSTriples(), + bugnumber="llvm.org/pr15824 thread states not properly maintained") + @expectedFailureAll( + oslist=["freebsd"], + bugnumber="llvm.org/pr18190 thread states not properly maintained") + @expectedFailureAll( + oslist=["windows"], + bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly") def test_step_in(self): """Test thread creation during step-in handling.""" self.build(dictionary=self.getBuildFlags()) - self.create_during_step_base("thread step-in -m all-threads", 'stop reason = step in') + self.create_during_step_base( + "thread step-in -m all-threads", + 'stop reason = step in') def setUp(self): # Call super's setUp(). @@ -56,19 +87,24 @@ class CreateDuringStepTestCase(TestBase): self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) # This should create a breakpoint in the stepping thread. - self.bp_num = lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.breakpoint, num_expected_locations=1) + self.bp_num = lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.breakpoint, num_expected_locations=1) # The breakpoint list should show 1 location. - self.expect("breakpoint list -f", "Breakpoint location shown correctly", - substrs = ["1: file = 'main.cpp', line = %d, locations = 1" % self.breakpoint]) + self.expect( + "breakpoint list -f", + "Breakpoint location shown correctly", + substrs=[ + "1: file = 'main.cpp', line = %d, locations = 1" % + self.breakpoint]) # Run the program. self.runCmd("run", RUN_SUCCEEDED) # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, - substrs = ['stopped', - 'stop reason = breakpoint']) + substrs=['stopped', + 'stop reason = breakpoint']) # Get the target process target = self.dbg.GetSelectedTarget() @@ -78,15 +114,21 @@ class CreateDuringStepTestCase(TestBase): num_threads = process.GetNumThreads() # Make sure we see only two threads - self.assertTrue(num_threads == 2, 'Number of expected threads and actual threads do not match.') + self.assertTrue( + num_threads == 2, + 'Number of expected threads and actual threads do not match.') # Get the thread objects thread1 = process.GetThreadAtIndex(0) thread2 = process.GetThreadAtIndex(1) # Make sure both threads are stopped - self.assertTrue(thread1.IsStopped(), "Thread 1 didn't stop during breakpoint") - self.assertTrue(thread2.IsStopped(), "Thread 2 didn't stop during breakpoint") + self.assertTrue( + thread1.IsStopped(), + "Thread 1 didn't stop during breakpoint") + self.assertTrue( + thread2.IsStopped(), + "Thread 2 didn't stop during breakpoint") # Find the thread that is stopped at the breakpoint stepping_thread = None @@ -95,7 +137,10 @@ class CreateDuringStepTestCase(TestBase): if expected_bp_desc in thread.GetStopDescription(100): stepping_thread = thread break - self.assertTrue(stepping_thread != None, "unable to find thread stopped at %s" % expected_bp_desc) + self.assertTrue( + stepping_thread is not None, + "unable to find thread stopped at %s" % + expected_bp_desc) current_line = self.breakpoint # Keep stepping until we've reached our designated continue point while current_line != self.continuepoint: @@ -108,21 +153,31 @@ class CreateDuringStepTestCase(TestBase): current_line = frame.GetLineEntry().GetLine() # Make sure we're still where we thought we were - self.assertTrue(current_line >= self.breakpoint, "Stepped to unexpected line, " + str(current_line)) - self.assertTrue(current_line <= self.continuepoint, "Stepped to unexpected line, " + str(current_line)) + self.assertTrue( + current_line >= self.breakpoint, + "Stepped to unexpected line, " + + str(current_line)) + self.assertTrue( + current_line <= self.continuepoint, + "Stepped to unexpected line, " + + str(current_line)) # Update the number of threads num_threads = process.GetNumThreads() # Check to see that we increased the number of threads as expected - self.assertTrue(num_threads == 3, 'Number of expected threads and actual threads do not match after thread exit.') + self.assertTrue( + num_threads == 3, + 'Number of expected threads and actual threads do not match after thread exit.') self.expect("thread list", 'Process state is stopped due to step', - substrs = ['stopped', - step_stop_reason]) + substrs=['stopped', + step_stop_reason]) # Run to completion self.runCmd("process continue") # At this point, the inferior process should have exited. - self.assertTrue(process.GetState() == lldb.eStateExited, PROCESS_EXITED) + self.assertTrue( + process.GetState() == lldb.eStateExited, + PROCESS_EXITED) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py index 2c394263d36..3b0d102c6cb 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py @@ -5,13 +5,14 @@ Test number of threads. from __future__ import print_function - -import os, time +import os +import time import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class ExitDuringBreakpointTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -22,10 +23,18 @@ class ExitDuringBreakpointTestCase(TestBase): # Find the line number for our breakpoint. self.breakpoint = line_number('main.cpp', '// Set breakpoint here') - @expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr15824 thread states not properly maintained") - @expectedFailureAll(oslist=lldbplatformutil.getDarwinOSTriples(), bugnumber="llvm.org/pr15824 thread states not properly maintained") - @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr18190 thread states not properly maintained") - @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly") + @expectedFailureAll( + oslist=["linux"], + bugnumber="llvm.org/pr15824 thread states not properly maintained") + @expectedFailureAll( + oslist=lldbplatformutil.getDarwinOSTriples(), + bugnumber="llvm.org/pr15824 thread states not properly maintained") + @expectedFailureAll( + oslist=["freebsd"], + bugnumber="llvm.org/pr18190 thread states not properly maintained") + @expectedFailureAll( + oslist=["windows"], + bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly") def test(self): """Test thread exit during breakpoint handling.""" self.build(dictionary=self.getBuildFlags()) @@ -33,19 +42,24 @@ class ExitDuringBreakpointTestCase(TestBase): self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) # This should create a breakpoint in the main thread. - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.breakpoint, num_expected_locations=1) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.breakpoint, num_expected_locations=1) # The breakpoint list should show 1 location. - self.expect("breakpoint list -f", "Breakpoint location shown correctly", - substrs = ["1: file = 'main.cpp', line = %d, locations = 1" % self.breakpoint]) + self.expect( + "breakpoint list -f", + "Breakpoint location shown correctly", + substrs=[ + "1: file = 'main.cpp', line = %d, locations = 1" % + self.breakpoint]) # Run the program. self.runCmd("run", RUN_SUCCEEDED) # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, - substrs = ['stopped', - 'stop reason = breakpoint']) + substrs=['stopped', + 'stop reason = breakpoint']) # Get the target process target = self.dbg.GetSelectedTarget() @@ -59,7 +73,9 @@ class ExitDuringBreakpointTestCase(TestBase): num_threads = process.GetNumThreads() # Make sure we see at least five threads - self.assertTrue(num_threads >= 5, 'Number of expected threads and actual threads do not match.') + self.assertTrue( + num_threads >= 5, + 'Number of expected threads and actual threads do not match.') # Get the thread objects thread1 = process.GetThreadAtIndex(0) @@ -69,14 +85,26 @@ class ExitDuringBreakpointTestCase(TestBase): thread5 = process.GetThreadAtIndex(4) # Make sure all threads are stopped - self.assertTrue(thread1.IsStopped(), "Thread 1 didn't stop during breakpoint") - self.assertTrue(thread2.IsStopped(), "Thread 2 didn't stop during breakpoint") - self.assertTrue(thread3.IsStopped(), "Thread 3 didn't stop during breakpoint") - self.assertTrue(thread4.IsStopped(), "Thread 4 didn't stop during breakpoint") - self.assertTrue(thread5.IsStopped(), "Thread 5 didn't stop during breakpoint") + self.assertTrue( + thread1.IsStopped(), + "Thread 1 didn't stop during breakpoint") + self.assertTrue( + thread2.IsStopped(), + "Thread 2 didn't stop during breakpoint") + self.assertTrue( + thread3.IsStopped(), + "Thread 3 didn't stop during breakpoint") + self.assertTrue( + thread4.IsStopped(), + "Thread 4 didn't stop during breakpoint") + self.assertTrue( + thread5.IsStopped(), + "Thread 5 didn't stop during breakpoint") # Run to completion self.runCmd("continue") # At this point, the inferior process should have exited. - self.assertTrue(process.GetState() == lldb.eStateExited, PROCESS_EXITED) + self.assertTrue( + process.GetState() == lldb.eStateExited, + PROCESS_EXITED) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py index af4a022ed0c..c27bd2d3e4d 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py @@ -5,34 +5,41 @@ Test number of threads. from __future__ import print_function - -import os, time +import os +import time import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class ExitDuringStepTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @skipIfFreeBSD # llvm.org/pr21411: test is hanging + @skipIfFreeBSD # llvm.org/pr21411: test is hanging def test(self): """Test thread exit during step handling.""" self.build(dictionary=self.getBuildFlags()) - self.exit_during_step_base("thread step-inst -m all-threads", 'stop reason = instruction step') + self.exit_during_step_base( + "thread step-inst -m all-threads", + 'stop reason = instruction step') - @skipIfFreeBSD # llvm.org/pr21411: test is hanging + @skipIfFreeBSD # llvm.org/pr21411: test is hanging def test_step_over(self): """Test thread exit during step-over handling.""" self.build(dictionary=self.getBuildFlags()) - self.exit_during_step_base("thread step-over -m all-threads", 'stop reason = step over') + self.exit_during_step_base( + "thread step-over -m all-threads", + 'stop reason = step over') - @skipIfFreeBSD # llvm.org/pr21411: test is hanging + @skipIfFreeBSD # llvm.org/pr21411: test is hanging def test_step_in(self): """Test thread exit during step-in handling.""" self.build(dictionary=self.getBuildFlags()) - self.exit_during_step_base("thread step-in -m all-threads", 'stop reason = step in') + self.exit_during_step_base( + "thread step-in -m all-threads", + 'stop reason = step in') def setUp(self): # Call super's setUp(). @@ -47,19 +54,24 @@ class ExitDuringStepTestCase(TestBase): self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) # This should create a breakpoint in the main thread. - self.bp_num = lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.breakpoint, num_expected_locations=1) + self.bp_num = lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.breakpoint, num_expected_locations=1) # The breakpoint list should show 1 location. - self.expect("breakpoint list -f", "Breakpoint location shown correctly", - substrs = ["1: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" % self.breakpoint]) + self.expect( + "breakpoint list -f", + "Breakpoint location shown correctly", + substrs=[ + "1: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" % + self.breakpoint]) # Run the program. self.runCmd("run", RUN_SUCCEEDED) # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, - substrs = ['stopped', - 'stop reason = breakpoint']) + substrs=['stopped', + 'stop reason = breakpoint']) # Get the target process target = self.dbg.GetSelectedTarget() @@ -67,14 +79,23 @@ class ExitDuringStepTestCase(TestBase): num_threads = process.GetNumThreads() # Make sure we see all three threads - self.assertGreaterEqual(num_threads, 3, 'Number of expected threads and actual threads do not match.') + self.assertGreaterEqual( + num_threads, + 3, + 'Number of expected threads and actual threads do not match.') - stepping_thread = lldbutil.get_one_thread_stopped_at_breakpoint_id(process, self.bp_num) - self.assertIsNotNone(stepping_thread, "Could not find a thread stopped at the breakpoint") + stepping_thread = lldbutil.get_one_thread_stopped_at_breakpoint_id( + process, self.bp_num) + self.assertIsNotNone( + stepping_thread, + "Could not find a thread stopped at the breakpoint") current_line = self.breakpoint stepping_frame = stepping_thread.GetFrameAtIndex(0) - self.assertEqual(current_line, stepping_frame.GetLineEntry().GetLine(), "Starting line for stepping doesn't match breakpoint line.") + self.assertEqual( + current_line, + stepping_frame.GetLineEntry().GetLine(), + "Starting line for stepping doesn't match breakpoint line.") # Keep stepping until we've reached our designated continue point while current_line != self.continuepoint: @@ -90,8 +111,16 @@ class ExitDuringStepTestCase(TestBase): current_line = frame.GetLineEntry().GetLine() - self.assertGreaterEqual(current_line, self.breakpoint, "Stepped to unexpected line, " + str(current_line)) - self.assertLessEqual(current_line, self.continuepoint, "Stepped to unexpected line, " + str(current_line)) + self.assertGreaterEqual( + current_line, + self.breakpoint, + "Stepped to unexpected line, " + + str(current_line)) + self.assertLessEqual( + current_line, + self.continuepoint, + "Stepped to unexpected line, " + + str(current_line)) self.runCmd("thread list") @@ -99,11 +128,14 @@ class ExitDuringStepTestCase(TestBase): new_num_threads = process.GetNumThreads() # Check to see that we reduced the number of threads as expected - self.assertEqual(new_num_threads, num_threads-1, 'Number of threads did not reduce by 1 after thread exit.') + self.assertEqual( + new_num_threads, + num_threads - 1, + 'Number of threads did not reduce by 1 after thread exit.') self.expect("thread list", 'Process state is stopped due to step', - substrs = ['stopped', - step_stop_reason]) + substrs=['stopped', + step_stop_reason]) # Run to completion self.runCmd("continue") diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py index 4c55bcd982a..26ee5d4084e 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py @@ -5,13 +5,14 @@ Test jumping to different places. from __future__ import print_function - -import os, time +import os +import time import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class ThreadJumpTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -29,31 +30,50 @@ class ThreadJumpTestCase(TestBase): self.mark4 = line_number('main.cpp', '// 4th marker') self.mark5 = line_number('other.cpp', '// other marker') - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.mark3, num_expected_locations=1) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.mark3, num_expected_locations=1) self.runCmd("run", RUN_SUCCEEDED) # The stop reason of the thread should be breakpoint 1. - self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT + " 1", - substrs=['stopped', 'main.cpp:{}'.format(self.mark3), 'stop reason = breakpoint 1']) + self.expect( + "thread list", + STOPPED_DUE_TO_BREAKPOINT + " 1", + substrs=[ + 'stopped', + 'main.cpp:{}'.format( + self.mark3), + 'stop reason = breakpoint 1']) - self.do_min_test(self.mark3, self.mark1, "i", "4"); # Try the int path, force it to return 'a' - self.do_min_test(self.mark3, self.mark2, "i", "5"); # Try the int path, force it to return 'b' - self.do_min_test(self.mark4, self.mark1, "j", "7"); # Try the double path, force it to return 'a' - self.do_min_test(self.mark4, self.mark2, "j", "8"); # Try the double path, force it to return 'b' + # Try the int path, force it to return 'a' + self.do_min_test(self.mark3, self.mark1, "i", "4") + # Try the int path, force it to return 'b' + self.do_min_test(self.mark3, self.mark2, "i", "5") + # Try the double path, force it to return 'a' + self.do_min_test(self.mark4, self.mark1, "j", "7") + # Try the double path, force it to return 'b' + self.do_min_test(self.mark4, self.mark2, "j", "8") # Try jumping to another function in a different file. - self.runCmd("thread jump --file other.cpp --line %i --force" % self.mark5) + self.runCmd( + "thread jump --file other.cpp --line %i --force" % + self.mark5) self.expect("process status", - substrs = ["at other.cpp:%i" % self.mark5]) + substrs=["at other.cpp:%i" % self.mark5]) # Try jumping to another function (without forcing) - self.expect("j main.cpp:%i" % self.mark1, COMMAND_FAILED_AS_EXPECTED, error = True, - substrs = ["error"]) - + self.expect( + "j main.cpp:%i" % + self.mark1, + COMMAND_FAILED_AS_EXPECTED, + error=True, + substrs=["error"]) + def do_min_test(self, start, jump, var, value): - self.runCmd("j %i" % start) # jump to the start marker + # jump to the start marker + self.runCmd("j %i" % start) self.runCmd("thread step-in") # step into the min fn - self.runCmd("j %i" % jump) # jump to the branch we're interested in + # jump to the branch we're interested in + self.runCmd("j %i" % jump) self.runCmd("thread step-out") # return out self.runCmd("thread step-over") # assign to the global - self.expect("expr %s" % var, substrs = [value]) # check it + self.expect("expr %s" % var, substrs=[value]) # check it diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py index d4b1eb32a9a..7f542d442ac 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py @@ -5,13 +5,14 @@ Test number of threads. from __future__ import print_function - -import os, time +import os +import time import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class MultipleBreakpointTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -22,10 +23,18 @@ class MultipleBreakpointTestCase(TestBase): # Find the line number for our breakpoint. self.breakpoint = line_number('main.cpp', '// Set breakpoint here') - @expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr15824 thread states not properly maintained") - @expectedFailureAll(oslist=lldbplatformutil.getDarwinOSTriples(), bugnumber="llvm.org/pr15824 thread states not properly maintained") - @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr18190 thread states not properly maintained") - @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly") + @expectedFailureAll( + oslist=["linux"], + bugnumber="llvm.org/pr15824 thread states not properly maintained") + @expectedFailureAll( + oslist=lldbplatformutil.getDarwinOSTriples(), + bugnumber="llvm.org/pr15824 thread states not properly maintained") + @expectedFailureAll( + oslist=["freebsd"], + bugnumber="llvm.org/pr18190 thread states not properly maintained") + @expectedFailureAll( + oslist=["windows"], + bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly") def test(self): """Test simultaneous breakpoints in multiple threads.""" self.build(dictionary=self.getBuildFlags()) @@ -33,11 +42,16 @@ class MultipleBreakpointTestCase(TestBase): self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) # This should create a breakpoint in the main thread. - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.breakpoint, num_expected_locations=1) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.breakpoint, num_expected_locations=1) # The breakpoint list should show 1 location. - self.expect("breakpoint list -f", "Breakpoint location shown correctly", - substrs = ["1: file = 'main.cpp', line = %d, locations = 1" % self.breakpoint]) + self.expect( + "breakpoint list -f", + "Breakpoint location shown correctly", + substrs=[ + "1: file = 'main.cpp', line = %d, locations = 1" % + self.breakpoint]) # Run the program. self.runCmd("run", RUN_SUCCEEDED) @@ -45,8 +59,8 @@ class MultipleBreakpointTestCase(TestBase): # The stop reason of the thread should be breakpoint. # The breakpoint may be hit in either thread 2 or thread 3. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, - substrs = ['stopped', - 'stop reason = breakpoint']) + substrs=['stopped', + 'stop reason = breakpoint']) # Get the target process target = self.dbg.GetSelectedTarget() @@ -56,7 +70,9 @@ class MultipleBreakpointTestCase(TestBase): num_threads = process.GetNumThreads() # Make sure we see all three threads - self.assertTrue(num_threads >= 3, 'Number of expected threads and actual threads do not match.') + self.assertTrue( + num_threads >= 3, + 'Number of expected threads and actual threads do not match.') # Get the thread objects thread1 = process.GetThreadAtIndex(0) @@ -64,9 +80,15 @@ class MultipleBreakpointTestCase(TestBase): thread3 = process.GetThreadAtIndex(2) # Make sure both threads are stopped - self.assertTrue(thread1.IsStopped(), "Primary thread didn't stop during breakpoint") - self.assertTrue(thread2.IsStopped(), "Secondary thread didn't stop during breakpoint") - self.assertTrue(thread3.IsStopped(), "Tertiary thread didn't stop during breakpoint") + self.assertTrue( + thread1.IsStopped(), + "Primary thread didn't stop during breakpoint") + self.assertTrue( + thread2.IsStopped(), + "Secondary thread didn't stop during breakpoint") + self.assertTrue( + thread3.IsStopped(), + "Tertiary thread didn't stop during breakpoint") # Delete the first breakpoint then continue self.runCmd("breakpoint delete 1") @@ -75,4 +97,6 @@ class MultipleBreakpointTestCase(TestBase): self.runCmd("continue") # At this point, the inferior process should have exited. - self.assertTrue(process.GetState() == lldb.eStateExited, PROCESS_EXITED) + self.assertTrue( + process.GetState() == lldb.eStateExited, + PROCESS_EXITED) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py index 5afb57bf4ba..c3604783d89 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py @@ -5,28 +5,37 @@ Test thread states. from __future__ import print_function - import unittest2 -import os, time +import os +import time import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class ThreadStateTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr15824 thread states not properly maintained") - @expectedFailureAll(oslist=lldbplatformutil.getDarwinOSTriples(), bugnumber="llvm.org/pr15824 thread states not properly maintained") - @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr18190 thread states not properly maintained") + @expectedFailureAll( + oslist=["linux"], + bugnumber="llvm.org/pr15824 thread states not properly maintained") + @expectedFailureAll( + oslist=lldbplatformutil.getDarwinOSTriples(), + bugnumber="llvm.org/pr15824 thread states not properly maintained") + @expectedFailureAll( + oslist=["freebsd"], + bugnumber="llvm.org/pr18190 thread states not properly maintained") def test_state_after_breakpoint(self): """Test thread state after breakpoint.""" self.build(dictionary=self.getBuildFlags(use_cpp11=False)) self.thread_state_after_breakpoint_test() - @skipIfDarwin # 'llvm.org/pr23669', cause Python crash randomly - @expectedFailureAll(oslist=lldbplatformutil.getDarwinOSTriples(), bugnumber="llvm.org/pr23669") + @skipIfDarwin # 'llvm.org/pr23669', cause Python crash randomly + @expectedFailureAll( + oslist=lldbplatformutil.getDarwinOSTriples(), + bugnumber="llvm.org/pr23669") @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr15824") @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24660") def test_state_after_continue(self): @@ -34,24 +43,31 @@ class ThreadStateTestCase(TestBase): self.build(dictionary=self.getBuildFlags(use_cpp11=False)) self.thread_state_after_continue_test() - @skipIfDarwin # 'llvm.org/pr23669', cause Python crash randomly + @skipIfDarwin # 'llvm.org/pr23669', cause Python crash randomly @expectedFailureDarwin('llvm.org/pr23669') @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24660") - @unittest2.expectedFailure("llvm.org/pr16712") # thread states not properly maintained + # thread states not properly maintained + @unittest2.expectedFailure("llvm.org/pr16712") def test_state_after_expression(self): """Test thread state after expression.""" self.build(dictionary=self.getBuildFlags(use_cpp11=False)) self.thread_state_after_expression_test() - @unittest2.expectedFailure("llvm.org/pr16712") # thread states not properly maintained - @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly") + # thread states not properly maintained + @unittest2.expectedFailure("llvm.org/pr16712") + @expectedFailureAll( + oslist=["windows"], + bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly") def test_process_interrupt(self): """Test process interrupt.""" self.build(dictionary=self.getBuildFlags(use_cpp11=False)) self.process_interrupt_test() - @unittest2.expectedFailure("llvm.org/pr15824") # thread states not properly maintained - @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly") + # thread states not properly maintained + @unittest2.expectedFailure("llvm.org/pr15824") + @expectedFailureAll( + oslist=["windows"], + bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly") def test_process_state(self): """Test thread states (comprehensive).""" self.build(dictionary=self.getBuildFlags(use_cpp11=False)) @@ -70,7 +86,8 @@ class ThreadStateTestCase(TestBase): self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) # This should create a breakpoint in the main thread. - bp = lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_1, num_expected_locations=1) + bp = lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.break_1, num_expected_locations=1) # Run the program. self.runCmd("run", RUN_SUCCEEDED) @@ -79,12 +96,16 @@ class ThreadStateTestCase(TestBase): target = self.dbg.GetSelectedTarget() process = target.GetProcess() - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonBreakpoint) self.assertIsNotNone(thread) # Make sure the thread is in the stopped state. - self.assertTrue(thread.IsStopped(), "Thread state isn't \'stopped\' during breakpoint 1.") - self.assertFalse(thread.IsSuspended(), "Thread state is \'suspended\' during breakpoint 1.") + self.assertTrue( + thread.IsStopped(), + "Thread state isn't \'stopped\' during breakpoint 1.") + self.assertFalse(thread.IsSuspended(), + "Thread state is \'suspended\' during breakpoint 1.") # Kill the process self.runCmd("process kill") @@ -92,8 +113,12 @@ class ThreadStateTestCase(TestBase): def wait_for_running_event(self, process): listener = self.dbg.GetListener() if lldb.remote_platform: - lldbutil.expect_state_changes(self, listener, process, [lldb.eStateConnected]) - lldbutil.expect_state_changes(self, listener, process, [lldb.eStateRunning]) + lldbutil.expect_state_changes( + self, listener, process, [ + lldb.eStateConnected]) + lldbutil.expect_state_changes( + self, listener, process, [ + lldb.eStateRunning]) def thread_state_after_continue_test(self): """Test thread state after continue.""" @@ -101,8 +126,10 @@ class ThreadStateTestCase(TestBase): self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) # This should create a breakpoint in the main thread. - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_1, num_expected_locations=1) - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_2, num_expected_locations=1) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.break_1, num_expected_locations=1) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.break_2, num_expected_locations=1) # Run the program. self.runCmd("run", RUN_SUCCEEDED) @@ -111,17 +138,23 @@ class ThreadStateTestCase(TestBase): target = self.dbg.GetSelectedTarget() process = target.GetProcess() - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonBreakpoint) self.assertIsNotNone(thread) - # Continue, the inferior will go into an infinite loop waiting for 'g_test' to change. + # Continue, the inferior will go into an infinite loop waiting for + # 'g_test' to change. self.dbg.SetAsync(True) self.runCmd("continue") self.wait_for_running_event(process) # Check the thread state. It should be running. - self.assertFalse(thread.IsStopped(), "Thread state is \'stopped\' when it should be running.") - self.assertFalse(thread.IsSuspended(), "Thread state is \'suspended\' when it should be running.") + self.assertFalse( + thread.IsStopped(), + "Thread state is \'stopped\' when it should be running.") + self.assertFalse( + thread.IsSuspended(), + "Thread state is \'suspended\' when it should be running.") # Go back to synchronous interactions self.dbg.SetAsync(False) @@ -135,8 +168,10 @@ class ThreadStateTestCase(TestBase): self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) # This should create a breakpoint in the main thread. - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_1, num_expected_locations=1) - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_2, num_expected_locations=1) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.break_1, num_expected_locations=1) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.break_2, num_expected_locations=1) # Run the program. self.runCmd("run", RUN_SUCCEEDED) @@ -145,27 +180,32 @@ class ThreadStateTestCase(TestBase): target = self.dbg.GetSelectedTarget() process = target.GetProcess() - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonBreakpoint) self.assertIsNotNone(thread) # Get the inferior out of its loop self.runCmd("expression g_test = 1") # Check the thread state - self.assertTrue(thread.IsStopped(), "Thread state isn't \'stopped\' after expression evaluation.") - self.assertFalse(thread.IsSuspended(), "Thread state is \'suspended\' after expression evaluation.") + self.assertTrue( + thread.IsStopped(), + "Thread state isn't \'stopped\' after expression evaluation.") + self.assertFalse( + thread.IsSuspended(), + "Thread state is \'suspended\' after expression evaluation.") # Let the process run to completion self.runCmd("process continue") - def process_interrupt_test(self): """Test process interrupt and continue.""" exe = os.path.join(os.getcwd(), "a.out") self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) # This should create a breakpoint in the main thread. - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_1, num_expected_locations=1) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.break_1, num_expected_locations=1) # Run the program. self.runCmd("run", RUN_SUCCEEDED) @@ -174,10 +214,12 @@ class ThreadStateTestCase(TestBase): target = self.dbg.GetSelectedTarget() process = target.GetProcess() - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonBreakpoint) self.assertIsNotNone(thread) - # Continue, the inferior will go into an infinite loop waiting for 'g_test' to change. + # Continue, the inferior will go into an infinite loop waiting for + # 'g_test' to change. self.dbg.SetAsync(True) self.runCmd("continue") self.wait_for_running_event(process) @@ -202,8 +244,10 @@ class ThreadStateTestCase(TestBase): self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) # This should create a breakpoint in the main thread. - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_1, num_expected_locations=1) - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_2, num_expected_locations=1) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.break_1, num_expected_locations=1) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.break_2, num_expected_locations=1) # Run the program. self.runCmd("run", RUN_SUCCEEDED) @@ -211,21 +255,30 @@ class ThreadStateTestCase(TestBase): # Get the target process target = self.dbg.GetSelectedTarget() process = target.GetProcess() - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonBreakpoint) self.assertIsNotNone(thread) # Make sure the thread is in the stopped state. - self.assertTrue(thread.IsStopped(), "Thread state isn't \'stopped\' during breakpoint 1.") - self.assertFalse(thread.IsSuspended(), "Thread state is \'suspended\' during breakpoint 1.") - - # Continue, the inferior will go into an infinite loop waiting for 'g_test' to change. + self.assertTrue( + thread.IsStopped(), + "Thread state isn't \'stopped\' during breakpoint 1.") + self.assertFalse(thread.IsSuspended(), + "Thread state is \'suspended\' during breakpoint 1.") + + # Continue, the inferior will go into an infinite loop waiting for + # 'g_test' to change. self.dbg.SetAsync(True) self.runCmd("continue") self.wait_for_running_event(process) # Check the thread state. It should be running. - self.assertFalse(thread.IsStopped(), "Thread state is \'stopped\' when it should be running.") - self.assertFalse(thread.IsSuspended(), "Thread state is \'suspended\' when it should be running.") + self.assertFalse( + thread.IsStopped(), + "Thread state is \'stopped\' when it should be running.") + self.assertFalse( + thread.IsSuspended(), + "Thread state is \'suspended\' when it should be running.") # Go back to synchronous interactions self.dbg.SetAsync(False) @@ -236,15 +289,22 @@ class ThreadStateTestCase(TestBase): self.assertEqual(thread.GetState(), lldb.eStopReasonSignal) # Check the thread state - self.assertTrue(thread.IsStopped(), "Thread state isn't \'stopped\' after process stop.") - self.assertFalse(thread.IsSuspended(), "Thread state is \'suspended\' after process stop.") + self.assertTrue( + thread.IsStopped(), + "Thread state isn't \'stopped\' after process stop.") + self.assertFalse(thread.IsSuspended(), + "Thread state is \'suspended\' after process stop.") # Get the inferior out of its loop self.runCmd("expression g_test = 1") # Check the thread state - self.assertTrue(thread.IsStopped(), "Thread state isn't \'stopped\' after expression evaluation.") - self.assertFalse(thread.IsSuspended(), "Thread state is \'suspended\' after expression evaluation.") + self.assertTrue( + thread.IsStopped(), + "Thread state isn't \'stopped\' after expression evaluation.") + self.assertFalse( + thread.IsSuspended(), + "Thread state is \'suspended\' after expression evaluation.") self.assertEqual(thread.GetState(), lldb.eStopReasonSignal) @@ -254,8 +314,11 @@ class ThreadStateTestCase(TestBase): self.assertEqual(thread.GetState(), lldb.eStopReasonBreakpoint) # Make sure both threads are stopped - self.assertTrue(thread.IsStopped(), "Thread state isn't \'stopped\' during breakpoint 2.") - self.assertFalse(thread.IsSuspended(), "Thread state is \'suspended\' during breakpoint 2.") + self.assertTrue( + thread.IsStopped(), + "Thread state isn't \'stopped\' during breakpoint 2.") + self.assertFalse(thread.IsSuspended(), + "Thread state is \'suspended\' during breakpoint 2.") # Run to completion self.runCmd("continue") diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py index 735ee80d624..f043013b90c 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py @@ -5,38 +5,54 @@ Test stepping out from a function in a multi-threaded program. from __future__ import print_function - -import os, time +import os +import time import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class ThreadStepOutTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @skipIfLinux # Test occasionally times out on the Linux build bot - @expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr23477 Test occasionally times out on the Linux build bot") - @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr18066 inferior does not exit") + # Test occasionally times out on the Linux build bot + @skipIfLinux + @expectedFailureAll( + oslist=["linux"], + bugnumber="llvm.org/pr23477 Test occasionally times out on the Linux build bot") + @expectedFailureAll( + oslist=["freebsd"], + bugnumber="llvm.org/pr18066 inferior does not exit") @expectedFailureAll(oslist=["windows"]) def test_step_single_thread(self): """Test thread step out on one thread via command interpreter. """ self.build(dictionary=self.getBuildFlags()) self.step_out_test(self.step_out_single_thread_with_cmd) - @skipIfLinux # Test occasionally times out on the Linux build bot - @expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr23477 Test occasionally times out on the Linux build bot") - @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr19347 2nd thread stops at breakpoint") + # Test occasionally times out on the Linux build bot + @skipIfLinux + @expectedFailureAll( + oslist=["linux"], + bugnumber="llvm.org/pr23477 Test occasionally times out on the Linux build bot") + @expectedFailureAll( + oslist=["freebsd"], + bugnumber="llvm.org/pr19347 2nd thread stops at breakpoint") @expectedFailureAll(oslist=["windows"]) def test_step_all_threads(self): """Test thread step out on all threads via command interpreter. """ self.build(dictionary=self.getBuildFlags()) self.step_out_test(self.step_out_all_threads_with_cmd) - @skipIfLinux # Test occasionally times out on the Linux build bot - @expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr23477 Test occasionally times out on the Linux build bot") - @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr19347 2nd thread stops at breakpoint") + # Test occasionally times out on the Linux build bot + @skipIfLinux + @expectedFailureAll( + oslist=["linux"], + bugnumber="llvm.org/pr23477 Test occasionally times out on the Linux build bot") + @expectedFailureAll( + oslist=["freebsd"], + bugnumber="llvm.org/pr19347 2nd thread stops at breakpoint") @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24681") def test_python(self): """Test thread step out on one thread via Python API (dwarf).""" @@ -48,43 +64,63 @@ class ThreadStepOutTestCase(TestBase): TestBase.setUp(self) # Find the line number for our breakpoint. self.breakpoint = line_number('main.cpp', '// Set breakpoint here') - if "gcc" in self.getCompiler() or self.isIntelCompiler(): - self.step_out_destination = line_number('main.cpp', '// Expect to stop here after step-out (icc and gcc)') + if "gcc" in self.getCompiler() or self.isIntelCompiler(): + self.step_out_destination = line_number( + 'main.cpp', '// Expect to stop here after step-out (icc and gcc)') else: - self.step_out_destination = line_number('main.cpp', '// Expect to stop here after step-out (clang)') + self.step_out_destination = line_number( + 'main.cpp', '// Expect to stop here after step-out (clang)') def step_out_single_thread_with_cmd(self): self.step_out_with_cmd("this-thread") - self.expect("thread backtrace all", "Thread location after step out is correct", - substrs = ["main.cpp:%d" % self.step_out_destination, - "main.cpp:%d" % self.breakpoint]) + self.expect( + "thread backtrace all", + "Thread location after step out is correct", + substrs=[ + "main.cpp:%d" % + self.step_out_destination, + "main.cpp:%d" % + self.breakpoint]) def step_out_all_threads_with_cmd(self): self.step_out_with_cmd("all-threads") - self.expect("thread backtrace all", "Thread location after step out is correct", - substrs = ["main.cpp:%d" % self.step_out_destination]) + self.expect( + "thread backtrace all", + "Thread location after step out is correct", + substrs=[ + "main.cpp:%d" % + self.step_out_destination]) def step_out_with_cmd(self, run_mode): self.runCmd("thread select %d" % self.step_out_thread.GetIndexID()) self.runCmd("thread step-out -m %s" % run_mode) self.expect("process status", "Expected stop reason to be step-out", - substrs = ["stop reason = step out"]) + substrs=["stop reason = step out"]) - self.expect("thread list", "Selected thread did not change during step-out", - substrs = ["* thread #%d" % self.step_out_thread.GetIndexID()]) + self.expect( + "thread list", + "Selected thread did not change during step-out", + substrs=[ + "* thread #%d" % + self.step_out_thread.GetIndexID()]) def step_out_with_python(self): self.step_out_thread.StepOut() reason = self.step_out_thread.GetStopReason() - self.assertEqual(lldb.eStopReasonPlanComplete, reason, - "Expected thread stop reason 'plancomplete', but got '%s'" % lldbutil.stop_reason_to_str(reason)) + self.assertEqual( + lldb.eStopReasonPlanComplete, + reason, + "Expected thread stop reason 'plancomplete', but got '%s'" % + lldbutil.stop_reason_to_str(reason)) # Verify location after stepping out frame = self.step_out_thread.GetFrameAtIndex(0) desc = lldbutil.get_description(frame.GetLineEntry()) expect = "main.cpp:%d" % self.step_out_destination - self.assertTrue(expect in desc, "Expected %s but thread stopped at %s" % (expect, desc)) + self.assertTrue( + expect in desc, "Expected %s but thread stopped at %s" % + (expect, desc)) def step_out_test(self, step_out_func): """Test single thread step out of a function.""" @@ -92,11 +128,16 @@ class ThreadStepOutTestCase(TestBase): self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) # This should create a breakpoint in the main thread. - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.breakpoint, num_expected_locations=1) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.breakpoint, num_expected_locations=1) # The breakpoint list should show 1 location. - self.expect("breakpoint list -f", "Breakpoint location shown correctly", - substrs = ["1: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" % self.breakpoint]) + self.expect( + "breakpoint list -f", + "Breakpoint location shown correctly", + substrs=[ + "1: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" % + self.breakpoint]) # Run the program. self.runCmd("run", RUN_SUCCEEDED) @@ -107,7 +148,10 @@ class ThreadStepOutTestCase(TestBase): # Get the number of threads, ensure we see all three. num_threads = self.inferior_process.GetNumThreads() - self.assertEqual(num_threads, 3, 'Number of expected threads and actual threads do not match.') + self.assertEqual( + num_threads, + 3, + 'Number of expected threads and actual threads do not match.') (breakpoint_threads, other_threads) = ([], []) lldbutil.sort_stopped_threads(self.inferior_process, @@ -115,10 +159,12 @@ class ThreadStepOutTestCase(TestBase): other_threads=other_threads) while len(breakpoint_threads) < 2: - self.runCmd("thread continue %s" % " ".join([str(x.GetIndexID()) for x in other_threads])) - lldbutil.sort_stopped_threads(self.inferior_process, - breakpoint_threads=breakpoint_threads, - other_threads=other_threads) + self.runCmd("thread continue %s" % + " ".join([str(x.GetIndexID()) for x in other_threads])) + lldbutil.sort_stopped_threads( + self.inferior_process, + breakpoint_threads=breakpoint_threads, + other_threads=other_threads) self.step_out_thread = breakpoint_threads[0] @@ -129,4 +175,5 @@ class ThreadStepOutTestCase(TestBase): self.runCmd("continue") # At this point, the inferior process should have exited. - self.assertTrue(self.inferior_process.GetState() == lldb.eStateExited, PROCESS_EXITED) + self.assertTrue(self.inferior_process.GetState() == + lldb.eStateExited, PROCESS_EXITED) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py index 2ba6f2e57f2..deedc4b7507 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py @@ -5,12 +5,13 @@ Test number of threads. from __future__ import print_function - -import os, time +import os +import time import lldb from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil + class ThreadExitTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -31,17 +32,28 @@ class ThreadExitTestCase(TestBase): self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) # This should create a breakpoint with 1 location. - bp1_id = lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_1, num_expected_locations=1) - bp2_id = lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_2, num_expected_locations=1) - bp3_id = lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_3, num_expected_locations=1) - bp4_id = lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.break_4, num_expected_locations=1) + bp1_id = lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.break_1, num_expected_locations=1) + bp2_id = lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.break_2, num_expected_locations=1) + bp3_id = lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.break_3, num_expected_locations=1) + bp4_id = lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.break_4, num_expected_locations=1) # The breakpoint list should show 1 locations. - self.expect("breakpoint list -f", "Breakpoint location shown correctly", - substrs = ["1: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" % self.break_1, - "2: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" % self.break_2, - "3: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" % self.break_3, - "4: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" % self.break_4]) + self.expect( + "breakpoint list -f", + "Breakpoint location shown correctly", + substrs=[ + "1: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" % + self.break_1, + "2: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" % + self.break_2, + "3: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" % + self.break_3, + "4: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" % + self.break_4]) # Run the program. self.runCmd("run", RUN_SUCCEEDED) @@ -49,39 +61,59 @@ class ThreadExitTestCase(TestBase): target = self.dbg.GetSelectedTarget() process = target.GetProcess() - stopped_thread = lldbutil.get_one_thread_stopped_at_breakpoint_id(process, bp1_id) - self.assertIsNotNone(stopped_thread, "Process is not stopped at breakpoint 1") + stopped_thread = lldbutil.get_one_thread_stopped_at_breakpoint_id( + process, bp1_id) + self.assertIsNotNone(stopped_thread, + "Process is not stopped at breakpoint 1") # Get the number of threads num_threads = process.GetNumThreads() - self.assertGreaterEqual(num_threads, 2, 'Number of expected threads and actual threads do not match at breakpoint 1.') + self.assertGreaterEqual( + num_threads, + 2, + 'Number of expected threads and actual threads do not match at breakpoint 1.') # Run to the second breakpoint self.runCmd("continue") - stopped_thread = lldbutil.get_one_thread_stopped_at_breakpoint_id(process, bp2_id) - self.assertIsNotNone(stopped_thread, "Process is not stopped at breakpoint 2") + stopped_thread = lldbutil.get_one_thread_stopped_at_breakpoint_id( + process, bp2_id) + self.assertIsNotNone(stopped_thread, + "Process is not stopped at breakpoint 2") # Update the number of threads new_num_threads = process.GetNumThreads() - self.assertEqual(new_num_threads, num_threads+1, 'Number of expected threads did not increase by 1 at bp 2.') + self.assertEqual( + new_num_threads, + num_threads + 1, + 'Number of expected threads did not increase by 1 at bp 2.') # Run to the third breakpoint self.runCmd("continue") - stopped_thread = lldbutil.get_one_thread_stopped_at_breakpoint_id(process, bp3_id) - self.assertIsNotNone(stopped_thread, "Process is not stopped at breakpoint 3") + stopped_thread = lldbutil.get_one_thread_stopped_at_breakpoint_id( + process, bp3_id) + self.assertIsNotNone(stopped_thread, + "Process is not stopped at breakpoint 3") # Update the number of threads new_num_threads = process.GetNumThreads() - self.assertEqual(new_num_threads, num_threads, 'Number of expected threads is not equal to original number of threads at bp 3.') + self.assertEqual( + new_num_threads, + num_threads, + 'Number of expected threads is not equal to original number of threads at bp 3.') # Run to the fourth breakpoint self.runCmd("continue") - stopped_thread = lldbutil.get_one_thread_stopped_at_breakpoint_id(process, bp4_id) - self.assertIsNotNone(stopped_thread, "Process is not stopped at breakpoint 4") + stopped_thread = lldbutil.get_one_thread_stopped_at_breakpoint_id( + process, bp4_id) + self.assertIsNotNone(stopped_thread, + "Process is not stopped at breakpoint 4") # Update the number of threads new_num_threads = process.GetNumThreads() - self.assertEqual(new_num_threads, num_threads-1, 'Number of expected threads did not decrease by 1 at bp 4.') + self.assertEqual( + new_num_threads, + num_threads - 1, + 'Number of expected threads did not decrease by 1 at bp 4.') # Run to completion self.runCmd("continue") diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py index 12bacabd0d7..0377b0c0a80 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py @@ -5,14 +5,15 @@ Test that we obey thread conditioned breakpoints. from __future__ import print_function - -import os, time +import os +import time import re import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class ThreadSpecificBreakTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -30,24 +31,42 @@ class ThreadSpecificBreakTestCase(TestBase): # This test works by setting a breakpoint in a function conditioned to stop only on # the main thread, and then calling this function on a secondary thread, joining, # and then calling again on the main thread. If the thread specific breakpoint works - # then it should not be hit on the secondary thread, only on the main thread. - - main_source_spec = lldb.SBFileSpec ("main.cpp") - - main_breakpoint = target.BreakpointCreateBySourceRegex("Set main breakpoint here", main_source_spec); - thread_breakpoint = target.BreakpointCreateBySourceRegex("Set thread-specific breakpoint here", main_source_spec) - - self.assertTrue(main_breakpoint.IsValid(), "Failed to set main breakpoint.") - self.assertGreater(main_breakpoint.GetNumLocations(), 0, "main breakpoint has no locations associated with it.") - self.assertTrue(thread_breakpoint.IsValid(), "Failed to set thread breakpoint.") - self.assertGreater(thread_breakpoint.GetNumLocations(), 0, "thread breakpoint has no locations associated with it.") - - process = target.LaunchSimple (None, None, self.get_process_working_directory()) + # then it should not be hit on the secondary thread, only on the main + # thread. + + main_source_spec = lldb.SBFileSpec("main.cpp") + + main_breakpoint = target.BreakpointCreateBySourceRegex( + "Set main breakpoint here", main_source_spec) + thread_breakpoint = target.BreakpointCreateBySourceRegex( + "Set thread-specific breakpoint here", main_source_spec) + + self.assertTrue( + main_breakpoint.IsValid(), + "Failed to set main breakpoint.") + self.assertGreater( + main_breakpoint.GetNumLocations(), + 0, + "main breakpoint has no locations associated with it.") + self.assertTrue( + thread_breakpoint.IsValid(), + "Failed to set thread breakpoint.") + self.assertGreater( + thread_breakpoint.GetNumLocations(), + 0, + "thread breakpoint has no locations associated with it.") + + process = target.LaunchSimple( + None, None, self.get_process_working_directory()) self.assertTrue(process, PROCESS_IS_VALID) - stopped_threads = lldbutil.get_threads_stopped_at_breakpoint(process, main_breakpoint) - self.assertEqual(len(stopped_threads), 1, "main breakpoint stopped at unexpected number of threads") + stopped_threads = lldbutil.get_threads_stopped_at_breakpoint( + process, main_breakpoint) + self.assertEqual( + len(stopped_threads), + 1, + "main breakpoint stopped at unexpected number of threads") main_thread = stopped_threads[0] main_thread_id = main_thread.GetThreadID() @@ -58,7 +77,17 @@ class ThreadSpecificBreakTestCase(TestBase): process.Continue() next_stop_state = process.GetState() - self.assertEqual(next_stop_state, lldb.eStateStopped, "We should have stopped at the thread breakpoint.") - stopped_threads = lldbutil.get_threads_stopped_at_breakpoint(process, thread_breakpoint) - self.assertEqual(len(stopped_threads), 1, "thread breakpoint stopped at unexpected number of threads") - self.assertEqual(stopped_threads[0].GetThreadID(), main_thread_id, "thread breakpoint stopped at the wrong thread") + self.assertEqual( + next_stop_state, + lldb.eStateStopped, + "We should have stopped at the thread breakpoint.") + stopped_threads = lldbutil.get_threads_stopped_at_breakpoint( + process, thread_breakpoint) + self.assertEqual( + len(stopped_threads), + 1, + "thread breakpoint stopped at unexpected number of threads") + self.assertEqual( + stopped_threads[0].GetThreadID(), + main_thread_id, + "thread breakpoint stopped at the wrong thread") diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py index ec5719d730d..da9ba59f992 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py @@ -6,20 +6,23 @@ conditioned breakpoints simultaneously from __future__ import print_function - -import os, time +import os +import time import re import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class ThreadSpecificBreakPlusConditionTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @skipIf(oslist=['windows', 'freebsd']) # test frequently times out or hangs - @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr18522') # hits break in another thread in testrun + # test frequently times out or hangs + @skipIf(oslist=['windows', 'freebsd']) + # hits break in another thread in testrun + @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr18522') @add_test_categories(['pyapi']) def test_python(self): """Test that we obey thread conditioned breakpoints.""" @@ -29,18 +32,24 @@ class ThreadSpecificBreakPlusConditionTestCase(TestBase): target = self.dbg.CreateTarget(exe) self.assertTrue(target, VALID_TARGET) - main_source_spec = lldb.SBFileSpec ("main.cpp") + main_source_spec = lldb.SBFileSpec("main.cpp") - # Set a breakpoint in the thread body, and make it active for only the first thread. - break_thread_body = target.BreakpointCreateBySourceRegex ("Break here in thread body.", main_source_spec) - self.assertTrue (break_thread_body.IsValid() and break_thread_body.GetNumLocations() > 0, "Failed to set thread body breakpoint.") + # Set a breakpoint in the thread body, and make it active for only the + # first thread. + break_thread_body = target.BreakpointCreateBySourceRegex( + "Break here in thread body.", main_source_spec) + self.assertTrue( + break_thread_body.IsValid() and break_thread_body.GetNumLocations() > 0, + "Failed to set thread body breakpoint.") - process = target.LaunchSimple (None, None, self.get_process_working_directory()) + process = target.LaunchSimple( + None, None, self.get_process_working_directory()) self.assertTrue(process, PROCESS_IS_VALID) - threads = lldbutil.get_threads_stopped_at_breakpoint (process, break_thread_body) - + threads = lldbutil.get_threads_stopped_at_breakpoint( + process, break_thread_body) + victim_thread = threads[0] # Pick one of the threads, and change the breakpoint so it ONLY stops for this thread, @@ -51,14 +60,18 @@ class ThreadSpecificBreakPlusConditionTestCase(TestBase): frame = victim_thread.GetFrameAtIndex(0) value = frame.FindVariable("my_value").GetValueAsSigned(0) - self.assertTrue (value > 0 and value < 11, "Got a reasonable value for my_value.") + self.assertTrue( + value > 0 and value < 11, + "Got a reasonable value for my_value.") - cond_string = "my_value != %d"%(value) + cond_string = "my_value != %d" % (value) break_thread_body.SetThreadID(victim_thread.GetThreadID()) - break_thread_body.SetCondition (cond_string) + break_thread_body.SetCondition(cond_string) process.Continue() next_stop_state = process.GetState() - self.assertTrue (next_stop_state == lldb.eStateExited, "We should have not hit the breakpoint again.") + self.assertTrue( + next_stop_state == lldb.eStateExited, + "We should have not hit the breakpoint again.") |