[Lldb-commits] [lldb] r355647 - Add logging to TestQueues.py

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 7 14:29:02 PST 2019


🎉🎉🎉

On Thu, Mar 7, 2019 at 2:26 PM Frederic Riss via lldb-commits <
lldb-commits at lists.llvm.org> wrote:

> Author: friss
> Date: Thu Mar  7 14:28:01 2019
> New Revision: 355647
>
> URL: http://llvm.org/viewvc/llvm-project?rev=355647&view=rev
> Log:
> Add logging to TestQueues.py
>
> In an attempt to understand why the test is still failing after r355555,
> add some logging.
>
> Modified:
>     lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
>
> Modified:
> lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py?rev=355647&r1=355646&r2=355647&view=diff
>
> ==============================================================================
> --- lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
> (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
> Thu Mar  7 14:28:01 2019
> @@ -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():
>
>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190307/8c9e5270/attachment-0001.html>


More information about the lldb-commits mailing list