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/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py | |
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/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py | 63 |
1 files changed, 42 insertions, 21 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py index d55416569ac..57d4d5ab4bb 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py @@ -5,7 +5,9 @@ from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil -class TestGdbRemoteThreadsInStopReply(gdbremote_testcase.GdbRemoteTestCaseBase): + +class TestGdbRemoteThreadsInStopReply( + gdbremote_testcase.GdbRemoteTestCaseBase): mydir = TestBase.compute_mydir(__file__) @@ -16,11 +18,12 @@ class TestGdbRemoteThreadsInStopReply(gdbremote_testcase.GdbRemoteTestCaseBase): def gather_stop_reply_threads(self, post_startup_log_lines, thread_count): # Set up the inferior args. - inferior_args=[] + inferior_args = [] for i in range(thread_count - 1): inferior_args.append("thread:new") inferior_args.append("sleep:10") - procs = self.prep_debug_monitor_and_inferior(inferior_args=inferior_args) + procs = self.prep_debug_monitor_and_inferior( + inferior_args=inferior_args) # Assumes test_sequence has anything added needed to setup the initial state. # (Like optionally enabling QThreadsInStopReply.) @@ -28,17 +31,25 @@ class TestGdbRemoteThreadsInStopReply(gdbremote_testcase.GdbRemoteTestCaseBase): self.test_sequence.add_log_lines(post_startup_log_lines, True) self.test_sequence.add_log_lines([ "read packet: $c#63" - ], True) + ], True) context = self.expect_gdbremote_sequence() self.assertIsNotNone(context) # Give threads time to start up, then break. time.sleep(1) self.reset_test_sequence() - self.test_sequence.add_log_lines([ - "read packet: {}".format(chr(3)), - {"direction":"send", "regex":r"^\$T([0-9a-fA-F]+)([^#]+)#[0-9a-fA-F]{2}$", "capture":{1:"stop_result", 2:"key_vals_text"} }, - ], True) + self.test_sequence.add_log_lines( + [ + "read packet: {}".format( + chr(3)), + { + "direction": "send", + "regex": r"^\$T([0-9a-fA-F]+)([^#]+)#[0-9a-fA-F]{2}$", + "capture": { + 1: "stop_result", + 2: "key_vals_text"}}, + ], + True) context = self.expect_gdbremote_sequence() self.assertIsNotNone(context) @@ -49,11 +60,14 @@ class TestGdbRemoteThreadsInStopReply(gdbremote_testcase.GdbRemoteTestCaseBase): # Run, then stop the process, grab the stop reply content. self.reset_test_sequence() - self.test_sequence.add_log_lines([ - "read packet: $c#63", - "read packet: {}".format(chr(3)), - {"direction":"send", "regex":r"^\$T([0-9a-fA-F]+)([^#]+)#[0-9a-fA-F]{2}$", "capture":{1:"stop_result", 2:"key_vals_text"} }, - ], True) + self.test_sequence.add_log_lines(["read packet: $c#63", + "read packet: {}".format(chr(3)), + {"direction": "send", + "regex": r"^\$T([0-9a-fA-F]+)([^#]+)#[0-9a-fA-F]{2}$", + "capture": {1: "stop_result", + 2: "key_vals_text"}}, + ], + True) context = self.expect_gdbremote_sequence() self.assertIsNotNone(context) @@ -66,13 +80,15 @@ class TestGdbRemoteThreadsInStopReply(gdbremote_testcase.GdbRemoteTestCaseBase): # Pull out threads from stop response. stop_reply_threads_text = kv_dict.get("threads") if stop_reply_threads_text: - return [int(thread_id, 16) for thread_id in stop_reply_threads_text.split(",")] + return [int(thread_id, 16) + for thread_id in stop_reply_threads_text.split(",")] else: return [] def QListThreadsInStopReply_supported(self): procs = self.prep_debug_monitor_and_inferior() - self.test_sequence.add_log_lines(self.ENABLE_THREADS_IN_STOP_REPLY_ENTRIES, True) + self.test_sequence.add_log_lines( + self.ENABLE_THREADS_IN_STOP_REPLY_ENTRIES, True) context = self.expect_gdbremote_sequence() self.assertIsNotNone(context) @@ -92,8 +108,10 @@ class TestGdbRemoteThreadsInStopReply(gdbremote_testcase.GdbRemoteTestCaseBase): self.QListThreadsInStopReply_supported() def stop_reply_reports_multiple_threads(self, thread_count): - # Gather threads from stop notification when QThreadsInStopReply is enabled. - stop_reply_threads = self.gather_stop_reply_threads(self.ENABLE_THREADS_IN_STOP_REPLY_ENTRIES, thread_count) + # Gather threads from stop notification when QThreadsInStopReply is + # enabled. + stop_reply_threads = self.gather_stop_reply_threads( + self.ENABLE_THREADS_IN_STOP_REPLY_ENTRIES, thread_count) self.assertEqual(len(stop_reply_threads), thread_count) @debugserver_test @@ -111,7 +129,8 @@ class TestGdbRemoteThreadsInStopReply(gdbremote_testcase.GdbRemoteTestCaseBase): self.stop_reply_reports_multiple_threads(5) def no_QListThreadsInStopReply_supplies_no_threads(self, thread_count): - # Gather threads from stop notification when QThreadsInStopReply is not enabled. + # Gather threads from stop notification when QThreadsInStopReply is not + # enabled. stop_reply_threads = self.gather_stop_reply_threads(None, thread_count) self.assertEqual(len(stop_reply_threads), 0) @@ -130,8 +149,10 @@ class TestGdbRemoteThreadsInStopReply(gdbremote_testcase.GdbRemoteTestCaseBase): self.no_QListThreadsInStopReply_supplies_no_threads(5) def stop_reply_reports_correct_threads(self, thread_count): - # Gather threads from stop notification when QThreadsInStopReply is enabled. - stop_reply_threads = self.gather_stop_reply_threads(self.ENABLE_THREADS_IN_STOP_REPLY_ENTRIES, thread_count) + # Gather threads from stop notification when QThreadsInStopReply is + # enabled. + stop_reply_threads = self.gather_stop_reply_threads( + self.ENABLE_THREADS_IN_STOP_REPLY_ENTRIES, thread_count) self.assertEqual(len(stop_reply_threads), thread_count) # Gather threads from q{f,s}ThreadInfo. @@ -144,7 +165,7 @@ class TestGdbRemoteThreadsInStopReply(gdbremote_testcase.GdbRemoteTestCaseBase): threads = self.parse_threadinfo_packets(context) self.assertIsNotNone(threads) self.assertEqual(len(threads), thread_count) - + # Ensure each thread in q{f,s}ThreadInfo appears in stop reply threads for tid in threads: self.assertTrue(tid in stop_reply_threads) |