From: Tom de Vries Date: Fri, 12 Dec 2025 08:35:23 +0000 (+0100) Subject: [gdb/testsuite] Fix timeout in gdb.base/async-shell.exp X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5f69c00a6e0704627ab1b529d3a2fcdf244da3e8;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Fix timeout in gdb.base/async-shell.exp For test-case gdb.base/async-shell.exp, I usually get: ... (gdb) run &^M Starting program: async-shell ^M (gdb) PASS: $exp: run & [Thread debugging using libthread_db enabled]^M Using host libthread_db library "/lib64/libthread_db.so.1".^M shell echo foo^M foo^M (gdb) PASS: $exp: shell echo foo ... And with taskset -c 11, I get instead: ... (gdb) run &^M Starting program: async-shell ^M (gdb) PASS: $exp: run & shell echo foo^M foo^M (gdb) PASS: $exp: shell echo foo [Thread debugging using libthread_db enabled]^M Using host libthread_db library "/lib64/libthread_db.so.1".^M ... With a gdb 16.3 based package I ran into: ... (gdb) run & Starting program: async-shell (gdb) PASS: $exp: run & shell echo foo foo (gdb) [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". FAIL: $exp: shell echo foo (timeout) ... I have tried to reproduce this using various timing tricks, but haven't managed. Nevertheless, I believe this can reproduced with trunk, so fix this using -no-prompt-anchor. PR testsuite/33667 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33667 --- diff --git a/gdb/testsuite/gdb.base/async-shell.exp b/gdb/testsuite/gdb.base/async-shell.exp index 228ed10008f..95d6cc28b99 100644 --- a/gdb/testsuite/gdb.base/async-shell.exp +++ b/gdb/testsuite/gdb.base/async-shell.exp @@ -34,7 +34,7 @@ gdb_test -no-prompt-anchor "run &" "Starting program: \[^\r\n\]*(\r\n$gdbindex_w # `sleep 5' here would workaround the bug, do not sleep here. # "shell" could eat waitpid event from the asynchronous inferior process. -gdb_test "shell echo foo" "foo" +gdb_test -no-prompt-anchor "shell echo foo" "foo" set test "interrupt" gdb_test_multiple $test $test {