aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite/test/dotest.py
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2020-04-14 08:41:50 -0700
committerJonas Devlieghere <jonas@devlieghere.com>2020-04-14 09:24:23 -0700
commitfc410138939fbc98d7eb700e0e898500a00efc4d (patch)
treefc6c99eec9108bbb1b19bb4a6b2251b733811d7c /lldb/packages/Python/lldbsuite/test/dotest.py
parentc1a9dd9aea498dd78d6583f29f15a690ddd5466a (diff)
downloadllvm-fc410138939fbc98d7eb700e0e898500a00efc4d.zip
llvm-fc410138939fbc98d7eb700e0e898500a00efc4d.tar.gz
llvm-fc410138939fbc98d7eb700e0e898500a00efc4d.tar.bz2
[lldb/Reproducers] Capture reproducers from the API test suite.
Make it possible to capture reproducers from the API test suite. Given the symmetry between capture and replay, this patch also adds the necessary code for replay. For now this is a NO-OP until the corresponding reproducer instrumentation changes land. For more info please refer to the RFC on lldb-dev: http://lists.llvm.org/pipermail/lldb-dev/2020-April/016100.html Differential revision: https://reviews.llvm.org/D77588
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/dotest.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/dotest.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index 31c617c..b5666ec 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -429,6 +429,17 @@ def parseOptionsAndInitTestdirs():
configuration.results_formatter_name = (
"lldbsuite.test_event.formatter.results_formatter.ResultsFormatter")
+ # Reproducer arguments
+ if args.capture_path and args.replay_path:
+ logging.error('Cannot specify both a capture and a replay path.')
+ sys.exit(-1)
+
+ if args.capture_path:
+ configuration.capture_path = args.capture_path
+
+ if args.replay_path:
+ configuration.replay_path = args.replay_path
+
# rerun-related arguments
configuration.rerun_all_issues = args.rerun_all_issues
@@ -955,8 +966,19 @@ def run_suite():
setupSysPath()
import lldbconfig
+ if configuration.capture_path or configuration.replay_path:
+ lldbconfig.INITIALIZE = False
import lldb
+ if configuration.capture_path:
+ lldb.SBReproducer.Capture(configuration.capture_path)
+ lldb.SBReproducer.SetAutoGenerate(True)
+ elif configuration.replay_path:
+ lldb.SBReproducer.PassiveReplay(configuration.replay_path)
+
+ if not lldbconfig.INITIALIZE:
+ lldb.SBDebugger.Initialize()
+
# Use host platform by default.
lldb.selected_platform = lldb.SBPlatform.GetHostPlatform()