Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH] [gdb/testsuite] Fix timeout in gdb.mi/mi-dprintf-modified.exp
Date: Thu, 29 Oct 2026 18:36:41 +0100	[thread overview]
Message-ID: <20261029173641.2135332-1-tdevries@suse.de> (raw)

With a gdb 17.2 based package, I ran into a timeout in test-case
gdb.mi/mi-dprintf-modified.exp:
...
(gdb)
PASS: $exp: get number for dprintf breakpoint
Expecting: ^(220-exec-next[
]+)?(.*[
]+[(]gdb[)]
[ ]*)
220-exec-next
220^running
*running,thread-id="all"
(gdb)
=library-loaded,id="/home/abuild/rpmbuild/BUILD/gdb-17.2/build-x86_64-suse-linux/gdb/testsuite.unix.-m64/outputs/gdb.mi/mi-dprintf-modified/mi-dprintf-modified-lib",target-name="/home/abuild/rpmbuild/BUILD/gdb-17.2/build-x86_64-suse-linux/gdb/testsuite.unix.-m64/outputs/gdb.mi/mi-dprintf-modified/mi-dprintf-modified-lib",host-name="/home/abuild/rpmbuild/BUILD/gdb-17.2/build-x86_64-suse-linux/gdb/testsuite.unix.-m64/outputs/gdb.mi/mi-dprintf-modified/mi-dprintf-modified-lib",symbols-loaded="0",thread-group="i1",ranges=[{from="0x00007ffff7fc7000",to="0x00007ffff7fca000"}]
*stopped,reason="end-stepping-range",frame={addr="0x000055555555480e",func="main",args=[],file="/home/abuild/rpmbuild/BUILD/gdb-17.2/gdb/testsuite/gdb.mi/mi-dprintf-modified.c",fullname="/home/abuild/rpmbuild/BUILD/gdb-17.2/gdb/testsuite/gdb.mi/mi-dprintf-modified.c",line="44",arch="i386:x86-64"},thread-id="1",stopped-threads="all",core="3"
(gdb)
PASS: $exp: next over dlopen
FAIL: $exp: wait for 'next' to complete (timeout)
...

This can be reliably reproduced on current trunk using:
...
-mi_gdb_test "220-exec-next" ".*" "next over dlopen"
+send_gdb "220-exec-next\n"
+sleep 1
+mi_gdb_test "" ".*" "next over dlopen"
...

The problem is the ".*", which consumes an MI prompt.

Fix this by anchoring the regexp on the output before the prompt.

Tested on x86_64-linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34915
---
 gdb/testsuite/gdb.mi/mi-dprintf-modified.exp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.mi/mi-dprintf-modified.exp b/gdb/testsuite/gdb.mi/mi-dprintf-modified.exp
index 641c4c552ae..edb4c968643 100644
--- a/gdb/testsuite/gdb.mi/mi-dprintf-modified.exp
+++ b/gdb/testsuite/gdb.mi/mi-dprintf-modified.exp
@@ -74,7 +74,8 @@ set bpnum [mi_get_valueof "/d" "\$bpnum" "INVALID" \
 	       "get number for dprintf breakpoint"]
 
 # Use 'next' to step over loading the shared library.
-mi_gdb_test "220-exec-next" ".*" "next over dlopen"
+set re_last_line [string_to_regexp {*running,thread-id="all"}]
+mi_gdb_test "220-exec-next" ".*$re_last_line" "next over dlopen"
 
 # Now wait for the 'stopped' notification.  While we wait we should
 # see a 'library-loaded' notification for the loading of the shared

base-commit: 3d34f4b057169a79b10e43b33c2156f839d5b92c
-- 
2.51.0


             reply	other threads:[~2026-10-29 17:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 17:36 Tom de Vries [this message]
2026-10-30 12:57 ` Guinevere Larsen
2026-10-30 16:19   ` Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261029173641.2135332-1-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox