aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2025-04-23 19:10:22 +0200
committerTom de Vries <tdevries@suse.de>2025-04-23 19:10:22 +0200
commit26011e4e104437220095003933df51633c8e966b (patch)
treeb8876233aa6bb6f7b1a2321576a7ffaf8e51dc06
parent37f5e02ef5be1ba47e80df4af690df26ee1dac83 (diff)
downloadbinutils-26011e4e104437220095003933df51633c8e966b.zip
binutils-26011e4e104437220095003933df51633c8e966b.tar.gz
binutils-26011e4e104437220095003933df51633c8e966b.tar.bz2
[gdb/testsuite] Fix another timeout in gdb.base/bg-execution-repeat.exp
With a gdb 16.2 based package, I ran into: ... (gdb) PASS: gdb.base/bg-execution-repeat.exp: c 1&: input still accepted interrupt (gdb) PASS: gdb.base/bg-execution-repeat.exp: c 1&: interrupt set var do_wait=0 (gdb) PASS: gdb.base/bg-execution-repeat.exp: c 1&: set var do_wait=0 continue& Cannot execute this command while the selected thread is running. (gdb) Program received signal SIGINT, Interrupt. PASS: gdb.base/bg-execution-repeat.exp: c 1&: continue& 0x00007ffff7cf1503 in clock_nanosleep@GLIBC_2.2.5 () from /lib64/libc.so.6 FAIL: gdb.base/bg-execution-repeat.exp: c 1&: breakpoint hit 2 (timeout) ... Fix this by waiting for "Program received signal SIGINT, Interrupt" after issuing the interrupt command. Tested on x86_64-linux.
-rw-r--r--gdb/testsuite/gdb.base/bg-execution-repeat.exp11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/bg-execution-repeat.exp b/gdb/testsuite/gdb.base/bg-execution-repeat.exp
index b1496ee..d5580fb 100644
--- a/gdb/testsuite/gdb.base/bg-execution-repeat.exp
+++ b/gdb/testsuite/gdb.base/bg-execution-repeat.exp
@@ -67,6 +67,17 @@ proc test {continue_cmd} {
# enable the "set var" command with an interrupt / continue& pair.
gdb_test -no-prompt-anchor "interrupt"
+ set test "interrupt received"
+ set re [string_to_regexp "Program received signal SIGINT, Interrupt."]
+ gdb_expect {
+ -re $re {
+ pass $test
+ }
+ timeout {
+ fail "$test (timeout)"
+ }
+ }
+
# Allow the breakpoint to trigger.
gdb_test -no-prompt-anchor "set var do_wait=0"