Differential D56233 Diff 194380 packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py
Changeset View
Changeset View
Standalone View
Standalone View
packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py
Show First 20 Lines • Show All 199 Lines • ▼ Show 20 Lines | class TestGdbRemoteThreadsInStopReply( | ||||
@skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet | @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet | ||||
@debugserver_test | @debugserver_test | ||||
def test_stop_reply_reports_multiple_threads_debugserver(self): | def test_stop_reply_reports_multiple_threads_debugserver(self): | ||||
self.init_debugserver_test() | self.init_debugserver_test() | ||||
self.build() | self.build() | ||||
self.set_inferior_startup_launch() | self.set_inferior_startup_launch() | ||||
self.stop_reply_reports_multiple_threads(5) | self.stop_reply_reports_multiple_threads(5) | ||||
# In current implementation of llgs on Windows, as a response to '\x03' packet, the debugger | |||||
# of the native process will trigger a call to DebugBreakProcess that will create a new thread | |||||
# to handle the exception debug event. So one more stop thread will be notified to the | |||||
# delegate, e.g. llgs. So tests below to assert the stop threads number will all fail. | |||||
labath: That sounds fun. Is that how things are supposed to work, or is that something you're planning… | |||||
@expectedFailureAll(oslist=["windows"]) | |||||
@llgs_test | @llgs_test | ||||
def test_stop_reply_reports_multiple_threads_llgs(self): | def test_stop_reply_reports_multiple_threads_llgs(self): | ||||
self.init_llgs_test() | self.init_llgs_test() | ||||
self.build() | self.build() | ||||
self.set_inferior_startup_launch() | self.set_inferior_startup_launch() | ||||
self.stop_reply_reports_multiple_threads(5) | self.stop_reply_reports_multiple_threads(5) | ||||
def no_QListThreadsInStopReply_supplies_no_threads(self, thread_count): | def no_QListThreadsInStopReply_supplies_no_threads(self, thread_count): | ||||
# Gather threads from stop notification when QThreadsInStopReply is not | # Gather threads from stop notification when QThreadsInStopReply is not | ||||
# enabled. | # enabled. | ||||
stop_reply_threads = self.gather_stop_reply_threads(None, thread_count) | stop_reply_threads = self.gather_stop_reply_threads(None, thread_count) | ||||
self.assertEqual(len(stop_reply_threads), 0) | self.assertEqual(len(stop_reply_threads), 0) | ||||
@skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet | @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet | ||||
@debugserver_test | @debugserver_test | ||||
def test_no_QListThreadsInStopReply_supplies_no_threads_debugserver(self): | def test_no_QListThreadsInStopReply_supplies_no_threads_debugserver(self): | ||||
self.init_debugserver_test() | self.init_debugserver_test() | ||||
self.build() | self.build() | ||||
self.set_inferior_startup_launch() | self.set_inferior_startup_launch() | ||||
self.no_QListThreadsInStopReply_supplies_no_threads(5) | self.no_QListThreadsInStopReply_supplies_no_threads(5) | ||||
@expectedFailureAll(oslist=["windows"]) | |||||
@llgs_test | @llgs_test | ||||
def test_no_QListThreadsInStopReply_supplies_no_threads_llgs(self): | def test_no_QListThreadsInStopReply_supplies_no_threads_llgs(self): | ||||
self.init_llgs_test() | self.init_llgs_test() | ||||
self.build() | self.build() | ||||
self.set_inferior_startup_launch() | self.set_inferior_startup_launch() | ||||
self.no_QListThreadsInStopReply_supplies_no_threads(5) | self.no_QListThreadsInStopReply_supplies_no_threads(5) | ||||
def stop_reply_reports_correct_threads(self, thread_count): | def stop_reply_reports_correct_threads(self, thread_count): | ||||
Show All 21 Lines | class TestGdbRemoteThreadsInStopReply( | ||||
@skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet | @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet | ||||
@debugserver_test | @debugserver_test | ||||
def test_stop_reply_reports_correct_threads_debugserver(self): | def test_stop_reply_reports_correct_threads_debugserver(self): | ||||
self.init_debugserver_test() | self.init_debugserver_test() | ||||
self.build() | self.build() | ||||
self.set_inferior_startup_launch() | self.set_inferior_startup_launch() | ||||
self.stop_reply_reports_correct_threads(5) | self.stop_reply_reports_correct_threads(5) | ||||
@expectedFailureAll(oslist=["windows"]) | |||||
@llgs_test | @llgs_test | ||||
def test_stop_reply_reports_correct_threads_llgs(self): | def test_stop_reply_reports_correct_threads_llgs(self): | ||||
self.init_llgs_test() | self.init_llgs_test() | ||||
self.build() | self.build() | ||||
self.set_inferior_startup_launch() | self.set_inferior_startup_launch() | ||||
self.stop_reply_reports_correct_threads(5) | self.stop_reply_reports_correct_threads(5) | ||||
def stop_reply_contains_thread_pcs(self, thread_count): | def stop_reply_contains_thread_pcs(self, thread_count): | ||||
results = self.gather_stop_reply_pcs( | results = self.gather_stop_reply_pcs( | ||||
self.ENABLE_THREADS_IN_STOP_REPLY_ENTRIES, thread_count) | self.ENABLE_THREADS_IN_STOP_REPLY_ENTRIES, thread_count) | ||||
stop_reply_pcs = results["thread_pcs"] | stop_reply_pcs = results["thread_pcs"] | ||||
pc_register = results["pc_register"] | pc_register = results["pc_register"] | ||||
little_endian = results["little_endian"] | little_endian = results["little_endian"] | ||||
self.assertEqual(len(stop_reply_pcs), thread_count) | self.assertEqual(len(stop_reply_pcs), thread_count) | ||||
threads_info_pcs = self.gather_threads_info_pcs(pc_register, | threads_info_pcs = self.gather_threads_info_pcs(pc_register, | ||||
little_endian) | little_endian) | ||||
self.assertEqual(len(threads_info_pcs), thread_count) | self.assertEqual(len(threads_info_pcs), thread_count) | ||||
for thread_id in stop_reply_pcs: | for thread_id in stop_reply_pcs: | ||||
self.assertTrue(thread_id in threads_info_pcs) | self.assertTrue(thread_id in threads_info_pcs) | ||||
self.assertTrue(int(stop_reply_pcs[thread_id], 16) | self.assertTrue(int(stop_reply_pcs[thread_id], 16) | ||||
== int(threads_info_pcs[thread_id], 16)) | == int(threads_info_pcs[thread_id], 16)) | ||||
@expectedFailureAll(oslist=["windows"]) | |||||
@llgs_test | @llgs_test | ||||
def test_stop_reply_contains_thread_pcs_llgs(self): | def test_stop_reply_contains_thread_pcs_llgs(self): | ||||
self.init_llgs_test() | self.init_llgs_test() | ||||
self.build() | self.build() | ||||
self.set_inferior_startup_launch() | self.set_inferior_startup_launch() | ||||
self.stop_reply_contains_thread_pcs(5) | self.stop_reply_contains_thread_pcs(5) | ||||
@skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet | @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet | ||||
@debugserver_test | @debugserver_test | ||||
def test_stop_reply_contains_thread_pcs_debugserver(self): | def test_stop_reply_contains_thread_pcs_debugserver(self): | ||||
self.init_debugserver_test() | self.init_debugserver_test() | ||||
self.build() | self.build() | ||||
self.set_inferior_startup_launch() | self.set_inferior_startup_launch() | ||||
self.stop_reply_contains_thread_pcs(5) | self.stop_reply_contains_thread_pcs(5) |
That sounds fun. Is that how things are supposed to work, or is that something you're planning to change/fix? (mostly just curious).