public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed 1/3] [gdb/testsuite] Consume output asap in gdb.server/multi-ui-errors.exp
Date: Sat, 29 Oct 2022 09:43:55 +0200	[thread overview]
Message-ID: <20221029074357.12305-2-tdevries@suse.de> (raw)
In-Reply-To: <20221029074357.12305-1-tdevries@suse.de>

With test-case gdb.server/multi-ui-errors.exp we see:
...
(gdb) PASS: multi-ui-errors.exp: main UI, prompt after gdbserver dies
continue^M
Continuing.^M
echo^M
(gdb) PASS: multi-ui-errors.exp: extra UI, prompt after gdbserver dies
...

The continue is issued earlier in the test-case, but the output has not been
consumed, which makes it show up much later.

Consume the continue output asap, to make it clear when the continue is issued:
...
(gdb) PASS: gdb.server/multi-ui-errors.exp: connect to gdbserver
continue^M
Continuing.^M
PASS: gdb.server/multi-ui-errors.exp: continue - extra UI
...

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.server/multi-ui-errors.exp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.server/multi-ui-errors.exp b/gdb/testsuite/gdb.server/multi-ui-errors.exp
index d3ddd0f2d08..8a1276fb272 100644
--- a/gdb/testsuite/gdb.server/multi-ui-errors.exp
+++ b/gdb/testsuite/gdb.server/multi-ui-errors.exp
@@ -75,7 +75,13 @@ with_spawn_id $extra_spawn_id {
 with_spawn_id $extra_spawn_id {
     gdb_test "target $gdbserver_protocol $gdbserver_gdbport" ".*" \
 	"connect to gdbserver"
-    send_gdb "continue\n"
+
+    # Issue a continue and consume the response.  Don't expect a prompt.
+    gdb_test_multiple "continue" "continue - extra UI" {
+	-re  "\r\nContinuing\.\r\n" {
+	    pass $gdb_test_name
+	}
+    }
 }
 
 # We're going to kill the gdbserver, but before we do, lets make sure
-- 
2.35.3


  reply	other threads:[~2022-10-29  7:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-29  7:43 [pushed 0/3] [gdb/testsuite] Various fixes for gdb.server/multi-ui-errors.exp Tom de Vries
2022-10-29  7:43 ` Tom de Vries [this message]
2022-10-29  7:43 ` [pushed 2/3] [gdb/testsuite] Fix gdb.server/multi-ui-errors.exp with local-remote-host-notty Tom de Vries
2022-10-29  7:43 ` [pushed 3/3] [gdb/testsuite] Use ssh -t in remote-*.exp 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=20221029074357.12305-2-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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).