Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH][gdb/testsuite] Fix gdb.multi/multi-term-settings.exp
@ 2021-09-28 17:57 Tom de Vries via Gdb-patches
  2021-09-28 18:14 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Tom de Vries via Gdb-patches @ 2021-09-28 17:57 UTC (permalink / raw)
  To: gdb-patches

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-29 13:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-28 17:57 [PATCH][gdb/testsuite] Fix gdb.multi/multi-term-settings.exp Tom de Vries via Gdb-patches
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox