From 610f55b542e95dbfa438cfda92f29c2704e8409f Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 17 Apr 2025 09:51:46 +0200 Subject: [PATCH] [gdb/testsuite] Fix gdb.threads/clone-attach-detach.exp With test-case gdb.threads/clone-attach-detach.exp I usually get: ... (gdb) attach &^M Attaching to program: clone-attach-detach, process ^M [New LWP ]^M (gdb) PASS: $exp: bg attach : attach [Thread debugging using libthread_db enabled]^M Using host libthread_db library "/lib64/libthread_db.so.1".^M ... but sometimes I run into: ... (gdb) attach &^M Attaching to program: clone-attach-detach, process ^M [New LWP ]^M (gdb) [Thread debugging using libthread_db enabled]^M Using host libthread_db library "/lib64/libthread_db.so.1".^M FAIL: $exp: bg attach : attach (timeout) ... I managed to reproduce this using make target check-readmore and READMORE_SLEEP=100. Fix this using -no-prompt-anchor. Tested on x86_64-linux. Approved-By: Simon Marchi --- gdb/testsuite/gdb.threads/clone-attach-detach.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.threads/clone-attach-detach.exp b/gdb/testsuite/gdb.threads/clone-attach-detach.exp index 0ae42819c7f..3da2c3ed9a6 100644 --- a/gdb/testsuite/gdb.threads/clone-attach-detach.exp +++ b/gdb/testsuite/gdb.threads/clone-attach-detach.exp @@ -74,7 +74,7 @@ set attempts 3 for {set attempt 1} {$attempt <= $attempts} {incr attempt} { with_test_prefix "bg attach $attempt" { - gdb_test "attach $testpid &" \ + gdb_test -no-prompt-anchor "attach $testpid &" \ "Attaching to program.*process $testpid.*" \ "attach" -- 2.47.2