Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [PATCH][gdb/testsuite] Fix gdb.multi/multi-term-settings.exp
Date: Tue, 28 Sep 2021 19:57:24 +0200	[thread overview]
Message-ID: <20210928175722.GA15861@delia> (raw)

Hi,

When running test-case gdb.multi/multi-term-settings.exp in conjunction with:
...
$ stress -c $(($(cat /proc/cpuinfo | grep -c ^processor) + 1))
...
I run into:
...
(gdb) PASS: gdb.multi/multi-term-settings.exp: \
  inf1_how=attach: inf2_how=attach: info inferiors
pid=14783, count=59^M
pid=14783, count=60^M
  ...
pid=14783, count=118^M
pid=14783, count=119^M
pid=14778, count=90^M
pid=14778, count=91^M
pid=14778, count=92^M
pid=14778, count=93^M
pid=14778, count=94^M
pid=14778, count=95^M
PASS: gdb.multi/multi-term-settings.exp: inf1_how=attach: inf2_how=attach: continue
Quit^M
(gdb) FAIL: gdb.multi/multi-term-settings.exp: \
  inf1_how=attach: inf2_how=attach: stop with control-c (SIGINT)
...

It occurred to me that the "Continuing." we see otherwise is not shown and
that it's possible that the control-C that is send is caught by gdb when
printing this.

Fix this by waiting for the "Continuing." message before sending control-C.

Tested on x86_64-linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=24929

Any comments?

Thanks,
- Tom

[gdb/testsuite] Fix gdb.multi/multi-term-settings.exp

---
 gdb/testsuite/gdb.multi/multi-term-settings.exp | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.multi/multi-term-settings.exp b/gdb/testsuite/gdb.multi/multi-term-settings.exp
index 20ec03d94b3..5b6cedbe509 100644
--- a/gdb/testsuite/gdb.multi/multi-term-settings.exp
+++ b/gdb/testsuite/gdb.multi/multi-term-settings.exp
@@ -196,13 +196,22 @@ proc coretest {inf1_how inf2_how} {
     set count2 0
 
     set test "continue"
+    set counting 0
     gdb_test_multiple $test $test {
+	-re "Continuing\\." {
+	    set counting 1
+	    exp_continue
+	}
 	-i $infs_spawn_ids -re "pid=$pid1, count=" {
-	    incr count1
+	    if { $counting } {
+		incr count1
+	    }
 	    pass_or_exp_continue
 	}
 	-i $infs_spawn_ids -re "pid=$pid2, count=" {
-	    incr count2
+	    if { $counting } {
+		incr count2
+	    }
 	    pass_or_exp_continue
 	}
 	-i $gdb_spawn_id -re "received signal SIGTTOU.*$gdb_prompt " {

             reply	other threads:[~2021-09-28 17:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28 17:57 Tom de Vries via Gdb-patches [this message]
2021-09-28 18:14 ` Pedro Alves
2021-09-28 22:42   ` Tom de Vries via Gdb-patches
2021-09-29 11:18     ` Pedro Alves
2021-09-29 13:56       ` Tom de Vries via Gdb-patches

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=20210928175722.GA15861@delia \
    --to=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