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/step_out | |
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/step_out')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py | 115 |
1 files changed, 81 insertions, 34 deletions
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) |