From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Fix gdb.mi/gdb2549.exp with check-read1
Date: Tue, 03 Mar 2020 10:36:00 -0000 [thread overview]
Message-ID: <20200303103608.GA16670@delia> (raw)
Hi,
When running gdb.mi/gdb2549.exp with check-read1, we get:
...
Running src/gdb/testsuite/gdb.mi/gdb2549.exp ...
FAIL: gdb.mi/gdb2549.exp: register values t (timeout)
...
The problem is that the command generates a lot of output, which is matched by
a single '.*':
...
mi_gdb_test "666-data-list-register-values t" \
"666\\^done,register-values=\\\[\{number=\"$decimal\",value=\"$binary\"\}.*\\\]" \
"register values t"
...
Fix this by splitting up the matching and calling exp_continue after each
number/value pair.
Tested on x86_64-linux with make targets check and check-read1.
Committed to trunk.
Thanks,
- Tom
[gdb/testsuite] Fix gdb.mi/gdb2549.exp with check-read1
gdb/testsuite/ChangeLog:
2020-03-03 Tom de Vries <tdevries@suse.de>
* gdb.mi/gdb2549.exp: Fix "register values t" check-read1 timeout.
---
gdb/testsuite/gdb.mi/gdb2549.exp | 33 ++++++++++++++++++++++++++++++---
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/gdb/testsuite/gdb.mi/gdb2549.exp b/gdb/testsuite/gdb.mi/gdb2549.exp
index 0b4cb6be38..cc6441c8ec 100644
--- a/gdb/testsuite/gdb.mi/gdb2549.exp
+++ b/gdb/testsuite/gdb.mi/gdb2549.exp
@@ -51,6 +51,7 @@ proc register_tests_no_exec { } {
proc register_tests { } {
global hex
global decimal
+ global mi_gdb_prompt
set octal "\[0-7\]+"
set binary "\[0-1\]+"
set float "\\-?((\[0-9\]+(\\.\[0-9\]+)?(e\[-+\]\[0-9\]+)?)|(nan\\($hex\\)))"
@@ -71,9 +72,35 @@ proc register_tests { } {
"555\\^done,register-values=\\\[\{number=\"$decimal\",value=\"$octal\"\}.*\\\]" \
"register values o"
- mi_gdb_test "666-data-list-register-values t" \
- "666\\^done,register-values=\\\[\{number=\"$decimal\",value=\"$binary\"\}.*\\\]" \
- "register values t"
+ set cmd "666-data-list-register-values t"
+ set test "register values t"
+ set state 0
+ gdb_test_multiple $cmd $test -prompt "$mi_gdb_prompt$" {
+ -re "666\\^done,register-values=\\\[" {
+ if { $state == 0 } {
+ set state 1
+ exp_continue
+ }
+ fail $gdb_test_name
+ }
+ -re "\{number=\"$decimal\",value=\"$binary\"\}" {
+ if { $state != 0 } {
+ set state 2
+ exp_continue
+ }
+ fail $gdb_test_name
+ }
+ -re "\{number=\"$decimal\",value=\"\[^\"\]*\"\}" {
+ exp_continue
+ }
+ -re "\]\r\n$mi_gdb_prompt$" {
+ if { $state == 2 } {
+ pass $gdb_test_name
+ } else {
+ fail $gdb_test_name
+ }
+ }
+ }
}
register_tests_no_exec
next reply other threads:[~2020-03-03 10:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-03 10:36 Tom de Vries [this message]
2021-10-08 11:08 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=20200303103608.GA16670@delia \
--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