From: Tom de Vries Date: Fri, 8 Oct 2021 11:07:52 +0000 (+0200) Subject: [gdb/testsuite] Fix gdb.mi/gdb2549.exp with check-read1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2550e478ad11b199780b733f2c657ab8ffdb0f14;p=binutils-gdb.git [gdb/testsuite] Fix gdb.mi/gdb2549.exp with check-read1 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. --- 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