[Lldb-commits] [PATCH] D16017: Fix TestMiniDump.py for Python 3

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 8 18:36:43 PST 2016


What's the extra frame?  Why does Python have an effect on the number of
frames seen by the minidump?  Something seems wrong about that.

On Fri, Jan 8, 2016 at 3:41 PM Adrian McCarthy <amccarth at google.com> wrote:

> amccarth created this revision.
> amccarth added a reviewer: zturner.
> amccarth added a subscriber: lldb-commits.
>
> Under Python 3, lldb sees an extra frame on the stack, so I check that the
> stack has at least the number frames we expect.
>
> Python 3 doesn't have dict.iteritems().  I used a wrapper function from
> six to keep this portable between the two versions.
>
> http://reviews.llvm.org/D16017
>
> Files:
>
> packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
>
> Index:
> packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
> ===================================================================
> ---
> packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
> +++
> packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
> @@ -3,7 +3,7 @@
>  """
>
>  from __future__ import print_function
> -
> +from six import iteritems
>
>
>  import lldb
> @@ -83,8 +83,8 @@
>              thread = process.GetThreadAtIndex(0)
>
>              expected_stack = { 0: 'bar', 1: 'foo', 2: 'main' }
> -            self.assertEqual(thread.GetNumFrames(), len(expected_stack))
> -            for index, name in expected_stack.iteritems():
> +            self.assertGreaterEqual(thread.GetNumFrames(),
> len(expected_stack))
> +            for index, name in iteritems(expected_stack):
>                  frame = thread.GetFrameAtIndex(index)
>                  self.assertTrue(frame.IsValid())
>                  function_name = frame.GetFunctionName()
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160109/5da6e515/attachment.html>


More information about the lldb-commits mailing list