[committed,gdb/testsuite] Fix gdb.mi/gdb2549.exp with check-read1

Message ID 20211008110829.GA27337@delia.home
State New
Headers show
Series
  • [committed,gdb/testsuite] Fix gdb.mi/gdb2549.exp with check-read1
Related show

Commit Message

Lancelot SIX via Gdb-patches Oct. 8, 2021, 11:08 a.m.
Hi,

When running test-case gdb.mi/gdb2549.exp with check-read1, I run into:
...
FAIL: gdb.mi/gdb2549.exp: register values x (timeout)
...

Fix this by applying the same fix as for "register values t" in commit
478e490a4df "[gdb/testsuite] Fix gdb.mi/gdb2549.exp with check-read1".

Tested on x86_64-linux.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix gdb.mi/gdb2549.exp with check-read1

---
 gdb/testsuite/gdb.mi/gdb2549.exp | 46 ++++++++++++++++++----------------------
 1 file changed, 21 insertions(+), 25 deletions(-)

Patch

diff --git a/gdb/testsuite/gdb.mi/gdb2549.exp b/gdb/testsuite/gdb.mi/gdb2549.exp
index aebf9c904d9..9cdc31e532c 100644
--- a/gdb/testsuite/gdb.mi/gdb2549.exp
+++ b/gdb/testsuite/gdb.mi/gdb2549.exp
@@ -43,42 +43,23 @@  proc register_tests_no_exec { } {
 		"no executable"
 }
 
-proc register_tests { } {
-    global hex
-    global decimal
+proc register_test { n arg format } {
     global mi_gdb_prompt
-    set octal "\[0-7\]+"
-    set binary "\[0-1\]+"
-    set float "\\-?((\[0-9\]+(\\.\[0-9\]+)?(e\[-+\]\[0-9\]+)?)|(nan\\($hex\\)))"
-
-    mi_gdb_test "222-data-list-register-values x" \
-	    "222\\^done,register-values=\\\[\{number=\"$decimal\",value=\"$hex\"\}.*\\\]" \
-	    "register values x"
-
-    mi_gdb_test "333-data-list-register-values f" \
-	    "333\\^done,register-values=\\\[\{number=\"$decimal\",value=\"$float\"\}.*\\\]" \
-	    "register values f"
-
-    mi_gdb_test "444-data-list-register-values d" \
-	    "444\\^done,register-values=\\\[\{number=\"$decimal\",value=\"-?$decimal\"\}.*\\\]" \
-	    "register values d"
+    global decimal
 
-    mi_gdb_test "555-data-list-register-values o" \
-	    "555\\^done,register-values=\\\[\{number=\"$decimal\",value=\"$octal\"\}.*\\\]" \
-	    "register values o"
+    set cmd "$n-data-list-register-values $arg"
+    set test "register values $arg"
 
-    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=\\\[" {
+	-re "$n\\^done,register-values=\\\[" {
 	    if { $state == 0 } {
 		set state 1
 		exp_continue
 	    }
 	    fail $gdb_test_name
 	}
-	-re "\{number=\"$decimal\",value=\"$binary\"\}" {
+	-re "\{number=\"$decimal\",value=\"$format\"\}" {
 	    if { $state != 0 } {
 		set state 2
 		exp_continue
@@ -98,6 +79,21 @@  proc register_tests { } {
     }
 }
 
+proc register_tests { } {
+    global hex
+    global decimal
+    set octal "\[0-7\]+"
+    set binary "\[0-1\]+"
+    set float \
+	"\\-?((\[0-9\]+(\\.\[0-9\]+)?(e\[-+\]\[0-9\]+)?)|(nan\\($hex\\)))"
+
+    register_test 222 x $hex
+    register_test 333 f $float
+    register_test 444 d -?$decimal
+    register_test 555 o $octal
+    register_test 666 t $binary
+}
+
 mi_clean_restart $binfile
 
 register_tests_no_exec