From 07f3e969f7ff78c50bc3d6d42b9e50911b9f0af7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20=C3=9Cbelacker?= Date: Mon, 3 Jun 2024 09:35:52 +0200 Subject: [PATCH] Move lldb setup script from commandline to the "interactive" prompt. Older versions of lldb seem to have an issue with the `test_setup.lldb` script, or at least the `process handle` commands. Therefore the test hangs because the output does not contain the `received signal: SIGKILL`. lldb version 14.0.6 --- src/test/util.py | 5 ++++- src/test/util.sh | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/test/util.py b/src/test/util.py index f6e2993853a..df856a486c8 100644 --- a/src/test/util.py +++ b/src/test/util.py @@ -1,4 +1,4 @@ -import pexpect, re, signal, sys, time +import pexpect, re, signal, sys, time, os __all__ = [ 'expect_rr', 'expect_list', 'expect_debugger', 'restart_replay', 'interrupt_gdb', 'expect_gdb', 'send_gdb', @@ -236,6 +236,9 @@ def set_up(): timeout=TIMEOUT_SEC, encoding='utf-8', logfile=open(log_file, 'w')) child.delaybeforesend = 0 expect_debugger(r'\(rr\)') + if debugger_type == 'LLDB': + script = os.environ["TESTDIR"] + "/test_setup.lldb" + send_lldb(f'command source -s 0 {script}') except Exception as e: failed('initializing rr and debugger', e) diff --git a/src/test/util.sh b/src/test/util.sh index f257a42bcc8..9d3d62ff1e9 100644 --- a/src/test/util.sh +++ b/src/test/util.sh @@ -152,7 +152,7 @@ test_passed=y nonce= # Set up the environment and working directory. -TESTDIR="${SRCDIR}/src/test" +export TESTDIR="${SRCDIR}/src/test" # Make rr treat temp files as durable. This saves copying all test # binaries into the trace. @@ -350,7 +350,7 @@ function debug { function debug_lldb_only { expectscript=$1; replayargs=$2 _RR_TRACE_DIR="$workdir" test-monitor $TIMEOUT debug.err \ python3 $TESTDIR/$expectscript.py --lldb \ - $RR_EXE $GLOBAL_OPTIONS replay -o-S -o$TESTDIR/test_setup.lldb $replayargs + $RR_EXE $GLOBAL_OPTIONS replay $replayargs if [[ $? == 0 ]]; then passed_msg lldb else