Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifications for old lldb version. #3757

Merged
merged 2 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/test/util.py
Original file line number Diff line number Diff line change
@@ -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',
Expand Down Expand Up @@ -137,11 +137,8 @@ def set_breakpoint_commands(number, commands):
expect_debugger('(rr)')

def expect_expression(expression, value):
send_debugger(f'print {expression}', f'print {expression}')
if debugger_type == 'GDB':
expect_debugger(f' = {value}')
else:
expect_debugger(fr'\) {value}')
send_debugger(f'print {expression}', f'expression -- {expression}')
expect_debugger(f' = {value}')

def expect_threads(num_threads, selected_thread):
send_debugger('info threads', 'thread list')
Expand Down Expand Up @@ -236,6 +233,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)

Expand Down
4 changes: 2 additions & 2 deletions src/test/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down