From 46fac9c4f270eac7072f88477385e973983b88f5 Mon Sep 17 00:00:00 2001 From: Frederic Riss Date: Thu, 7 Mar 2019 22:28:01 +0000 Subject: [PATCH] Add logging to TestQueues.py In an attempt to understand why the test is still failing after r355555, add some logging. llvm-svn: 355647 --- .../lldbsuite/test/macosx/queues/TestQueues.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lldb/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py b/lldb/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py index cdc9606..50b4743 100644 --- a/lldb/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py +++ b/lldb/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py @@ -56,7 +56,23 @@ class TestQueues(TestBase): expected_running, (queue.GetNumRunningItems()))) + def describe_threads(self): + desc = [] + for x in self.inferior_process: + id = x.GetIndexID() + reason_str = lldbutil.stop_reason_to_str(x.GetStopReason()) + + location = "\t".join([lldbutil.get_description( + x.GetFrameAtIndex(i)) for i in range(x.GetNumFrames())]) + desc.append( + "thread %d: %s at\n\t%s" % + (id, reason_str, location)) + print('\n'.join(desc)) + def check_number_of_threads_owned_by_queue(self, queue, number_threads): + if (queue.GetNumThreads() != number_threads): + self.describe_threads() + self.assertTrue( queue.GetNumThreads() == number_threads, "queue %s should have %d thread executing, but has %d" % @@ -125,6 +141,8 @@ class TestQueues(TestBase): if len(threads) != 1: self.fail("Failed to stop at breakpoint 1.") + self.inferior_process = process + queue_submittor_1 = lldb.SBQueue() queue_performer_1 = lldb.SBQueue() queue_performer_2 = lldb.SBQueue() @@ -291,6 +309,8 @@ class TestQueues(TestBase): if len(threads) != 1: self.fail("Failed to stop at breakpoint 1.") + self.inferior_process = process + libbtr_module_filespec = lldb.SBFileSpec("libBacktraceRecording.dylib") libbtr_module = target.FindModule(libbtr_module_filespec) if not libbtr_module.IsValid(): -- 2.7.4