diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2022-08-03 11:42:12 -0700 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2022-08-03 11:44:13 -0700 |
commit | 0f821339dad1bf45dd71a1cac32b6352ba251ecb (patch) | |
tree | a324aaed0dee45aad11f4d5972e18f98f70ebb2c /lldb/packages/Python/lldbsuite/test/lldbutil.py | |
parent | 371610793491fcd1c9af114a0de0cdda9a4408b0 (diff) | |
download | llvm-0f821339dad1bf45dd71a1cac32b6352ba251ecb.zip llvm-0f821339dad1bf45dd71a1cac32b6352ba251ecb.tar.gz llvm-0f821339dad1bf45dd71a1cac32b6352ba251ecb.tar.bz2 |
[lldb] Add assertStopReason helper function
Add a function to make it easier to debug a test failure caused by an
unexpected stop reason. This is similar to the assertState helper that
was added in ce825e46743b.
Before:
self.assertEqual(stop_reason, lldb.eStopReasonInstrumentation)
AssertionError: 5 != 10
After:
self.assertStopReason(stop_reason, lldb.eStopReasonInstrumentation)
AssertionError: signal (5) != instrumentation (10)
Differential revision: https://reviews.llvm.org/D131083
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbutil.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/lldbutil.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbutil.py b/lldb/packages/Python/lldbsuite/test/lldbutil.py index 7863e64..f21f492 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbutil.py +++ b/lldb/packages/Python/lldbsuite/test/lldbutil.py @@ -266,6 +266,10 @@ def stop_reason_to_str(enum): return "plancomplete" elif enum == lldb.eStopReasonThreadExiting: return "threadexiting" + elif enum == lldb.eStopReasonInstrumentation: + return "instrumentation" + elif enum == lldb.eStopReasonProcessorTrace: + return "processortrace" else: raise Exception("Unknown StopReason enum") |