Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Guinevere Larsen <guinevere@redhat.com>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb/testsuite] Fix timeout in gdb.mi/mi-dprintf-modified.exp
Date: Fri, 30 Oct 2026 09:57:40 -0300	[thread overview]
Message-ID: <cf27b420-4e4a-41e4-9e86-cbb53749fe9f@redhat.com> (raw)
In-Reply-To: <20261029173641.2135332-1-tdevries@suse.de>

On 10/29/26 2:36 PM, Tom de Vries wrote:
> 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.

Hi Tom! Thanks for working on this

I have checked that this patch does solve the issue but the explanation 
is confusing. It is technically correct to say that the problem is ".*" 
consuming an MI prompt, but I think the following is a better explanation:

    The problem is that ".*" may consume past the prompt and read the 
messages that the following
    gdb_test_multiple expects to consume, if they are produced fast enough.


Apart from this nit, I think this patch is a great fix

Reviewed-By: Guinevere Larsen <guinevere@redhat.com>

-- 
Cheers,
Guinevere Larsen
it/its
she/her (deprecated)

>
> 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


  reply	other threads:[~2026-10-30 12:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 17:36 Tom de Vries
2026-10-30 12:57 ` Guinevere Larsen [this message]
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=cf27b420-4e4a-41e4-9e86-cbb53749fe9f@redhat.com \
    --to=guinevere@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /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