diff --git a/src/test/dlopen.py b/src/test/dlopen.py index 1a31e699fe1..c728313bc4e 100644 --- a/src/test/dlopen.py +++ b/src/test/dlopen.py @@ -5,6 +5,6 @@ expect_gdb('EXIT-SUCCESS') expect_gdb('SIGKILL') send_gdb('reverse-continue') -expect_gdb('No more reverse-execution history') +expect_history_end() ok() diff --git a/src/test/mmap_replace_most_mappings.py b/src/test/mmap_replace_most_mappings.py index 7d14e76f663..21fad97c31a 100644 --- a/src/test/mmap_replace_most_mappings.py +++ b/src/test/mmap_replace_most_mappings.py @@ -9,7 +9,7 @@ send_gdb('restart 1') expect_gdb('stopped') send_gdb('rc') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('restart 1') expect_gdb('stopped') send_gdb('c') diff --git a/src/test/mprotect_checkpoint.py b/src/test/mprotect_checkpoint.py index 915d887720f..5ce2dc8ca61 100644 --- a/src/test/mprotect_checkpoint.py +++ b/src/test/mprotect_checkpoint.py @@ -11,6 +11,6 @@ send_gdb('ignore 1 1000000') expect_gdb('Will ignore') send_gdb('reverse-continue') -expect_gdb('No more reverse-execution history') +expect_history_end() ok() diff --git a/src/test/ptrace_remote_unmap.py b/src/test/ptrace_remote_unmap.py index 2c239df9bee..1407c980cc0 100644 --- a/src/test/ptrace_remote_unmap.py +++ b/src/test/ptrace_remote_unmap.py @@ -9,6 +9,6 @@ send_gdb('restart 1') expect_gdb('stopped') send_gdb('rc') -expect_gdb('No more reverse-execution history') +expect_history_end() ok() diff --git a/src/test/reverse_continue_exec_subprocess.py b/src/test/reverse_continue_exec_subprocess.py index c989d92af26..4670dfdb3e3 100644 --- a/src/test/reverse_continue_exec_subprocess.py +++ b/src/test/reverse_continue_exec_subprocess.py @@ -2,25 +2,25 @@ import re send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('reverse-stepi') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('b main') expect_gdb('Breakpoint 1') send_gdb('c') expect_gdb('Breakpoint 1') send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('reverse-stepi') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() ok() diff --git a/src/test/reverse_continue_fork_subprocess.py b/src/test/reverse_continue_fork_subprocess.py index b861515e6b0..952a23d1475 100644 --- a/src/test/reverse_continue_fork_subprocess.py +++ b/src/test/reverse_continue_fork_subprocess.py @@ -2,29 +2,29 @@ import re send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('reverse-stepi') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('stepi') send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('reverse-stepi') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('stepi') send_gdb('reverse-stepi') send_gdb('reverse-stepi') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() ok() diff --git a/src/test/reverse_continue_int3.py b/src/test/reverse_continue_int3.py index 69edea65bfe..eeeecdff6ce 100644 --- a/src/test/reverse_continue_int3.py +++ b/src/test/reverse_continue_int3.py @@ -7,6 +7,6 @@ expect_gdb('SIGTRAP') send_gdb('rc') -expect_gdb('No more reverse-execution history') +expect_history_end() ok() diff --git a/src/test/reverse_continue_process_signal.py b/src/test/reverse_continue_process_signal.py index f98df342436..7984b55c866 100644 --- a/src/test/reverse_continue_process_signal.py +++ b/src/test/reverse_continue_process_signal.py @@ -5,6 +5,6 @@ send_gdb('c') expect_gdb('SIGKILL') send_gdb('reverse-continue') -expect_gdb('No more reverse-execution history') +expect_history_end() ok() diff --git a/src/test/reverse_continue_start.py b/src/test/reverse_continue_start.py index a5a3b2bda00..10ab19f0ce6 100644 --- a/src/test/reverse_continue_start.py +++ b/src/test/reverse_continue_start.py @@ -2,20 +2,20 @@ import re send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('reverse-stepi') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('b main') expect_gdb('Breakpoint 1') send_gdb('c') expect_gdb('Breakpoint 1') send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('reverse-stepi') -expect_gdb('No more reverse-execution history') +expect_history_end() send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() ok() diff --git a/src/test/reverse_step_signal.py b/src/test/reverse_step_signal.py index f07a0a1dfa1..9c8b8ffbe8b 100644 --- a/src/test/reverse_step_signal.py +++ b/src/test/reverse_step_signal.py @@ -25,6 +25,6 @@ expect_gdb('received signal') send_gdb('reverse-continue') -expect_gdb('No more reverse-execution history') +expect_history_end() ok() diff --git a/src/test/reverse_watchpoint.py b/src/test/reverse_watchpoint.py index bf771d735a8..91d869f6245 100644 --- a/src/test/reverse_watchpoint.py +++ b/src/test/reverse_watchpoint.py @@ -34,6 +34,6 @@ expect_gdb('New value = 0') send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() ok() diff --git a/src/test/simple_winch.py b/src/test/simple_winch.py index 3f08effa0c2..d77e5ffa18b 100644 --- a/src/test/simple_winch.py +++ b/src/test/simple_winch.py @@ -13,6 +13,6 @@ expect_gdb('Breakpoint 1') send_gdb('!kill -WINCH 0') send_gdb('reverse-cont') -expect_gdb('No more reverse-execution history') +expect_history_end() ok() diff --git a/src/test/stack_overflow_debug.py b/src/test/stack_overflow_debug.py index 13ef6c28e97..9bc6a5f01c5 100644 --- a/src/test/stack_overflow_debug.py +++ b/src/test/stack_overflow_debug.py @@ -14,6 +14,6 @@ send_gdb('reverse-stepi') expect_gdb('SIGSEGV') send_gdb('reverse-continue') -expect_gdb('No more reverse-execution history') +expect_history_end() ok() diff --git a/src/test/util.py b/src/test/util.py index 1afa2f59f41..c2f2190aa7e 100644 --- a/src/test/util.py +++ b/src/test/util.py @@ -6,6 +6,7 @@ 'get_gdb_version', 'breakpoint_at_function', 'watchpoint_at_address', 'cont', 'backtrace', 'up', 'expect_breakpoint_stop', 'expect_watchpoint_stop', + 'expect_history_end', 'history_end_regex', 'delete_watchpoint', 'expect_signal_stop', 'set_breakpoint_commands', 'select_thread', 'scheduler_locking_on', 'scheduler_locking_off', @@ -121,6 +122,16 @@ def up(): def backtrace(): send_debugger('bt', 'thread backtrace') +def history_end_regex(): + if debugger_type == 'GDB': + return 'No more reverse-execution history|Reached end of recorded history' + else: + # Add LLDB case + assert False + +def expect_history_end(): + expect_debugger(history_end_regex()) + def expect_breakpoint_stop(number): if debugger_type == 'GDB': expect_debugger(f'Breakpoint {number}') diff --git a/src/test/vfork_read_clone_stress.py b/src/test/vfork_read_clone_stress.py index c2c1577e35b..f9257495340 100644 --- a/src/test/vfork_read_clone_stress.py +++ b/src/test/vfork_read_clone_stress.py @@ -7,7 +7,7 @@ expect_gdb('Program received signal SIGKILL') send_gdb('rc') -expect_gdb(['(No more reverse-execution history)', '(child)']) +expect_gdb([f'({history_end_regex()})', '(child)']) assert 'child' not in last_match().group(1) diff --git a/src/test/watch_code.py b/src/test/watch_code.py index 48f4df525c1..122c4b25d6b 100644 --- a/src/test/watch_code.py +++ b/src/test/watch_code.py @@ -9,6 +9,6 @@ expect_gdb('Hardware watchpoint 2') send_gdb('reverse-continue') -expect_gdb('No more reverse-execution history') +expect_history_end() ok()