[Lldb-commits] [PATCH] D70314: [lldb] Add better test commands for expression evaluation

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 15 03:05:55 PST 2020


labath added a comment.

This seems fine, assuming it is sufficient to achieve your goals.



================
Comment at: lldb/packages/Python/lldbsuite/test/lldbtest.py:2396-2407
+            if type(expected) is list:
+                remaining = got
+                for expected_part in expected:
+                    # Find the expected string.
+                    i = remaining.find(expected_part)
+                    # Assert that we found the string.
+                    outer_self.assertTrue(i != -1, "Couldn't find '" + expected_part
----------------
maybe something like `self.expect(got, substrs=expected, exe=False)` ?


================
Comment at: lldb/packages/Python/lldbsuite/test/lldbtest.py:2413
+
+        frame = self.dbg.GetTargetAtIndex(0).GetProcess().GetThreadAtIndex(0).GetFrameAtIndex(0)
+        eval_result = frame.EvaluateExpression(expr)
----------------
`frame = self.frame()`. If it turns out useful, we could also add an argument to run the expression on a specific frame...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70314/new/

https://reviews.llvm.org/D70314





More information about the lldb-commits mailing list