From 158da0d12a7c9bb01c6d9b8d3da609a1e2561916 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 25 Oct 2019 10:48:12 +0200 Subject: [PATCH] [gdb/testsuite] Use -wrap and $gdb_test_name in gdb_test_multiple calls (2) Make gdb_test_multiple calls shorter by using new gdb_test_multiple variable $gdb_test_name and new gdb_test_multiple pattern flag -wrap. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-10-25 Tom de Vries * gdb.reverse/sigall-precsave.exp: Use -wrap and $gdb_test_name in gdb_test_multiple calls. * gdb.reverse/sigall-reverse.exp: Same. * gdb.reverse/solib-precsave.exp: Same. * gdb.reverse/solib-reverse.exp: Same. * gdb.reverse/until-precsave.exp: Same. * gdb.reverse/until-reverse.exp: Same. Change-Id: I67bb327d069dbc439410996bcfe6c7f905b2ca52 --- gdb/testsuite/ChangeLog | 10 +++++++++ gdb/testsuite/gdb.reverse/sigall-precsave.exp | 14 +++++------- gdb/testsuite/gdb.reverse/sigall-reverse.exp | 22 +++++++++---------- gdb/testsuite/gdb.reverse/solib-precsave.exp | 13 +++++------ gdb/testsuite/gdb.reverse/solib-reverse.exp | 13 +++++------ gdb/testsuite/gdb.reverse/until-precsave.exp | 13 +++++------ gdb/testsuite/gdb.reverse/until-reverse.exp | 13 +++++------ 7 files changed, 47 insertions(+), 51 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index faee8e0f1cb..b4228ce63ec 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2019-10-25 Tom de Vries + + * gdb.reverse/sigall-precsave.exp: Use -wrap and $gdb_test_name in + gdb_test_multiple calls. + * gdb.reverse/sigall-reverse.exp: Same. + * gdb.reverse/solib-precsave.exp: Same. + * gdb.reverse/solib-reverse.exp: Same. + * gdb.reverse/until-precsave.exp: Same. + * gdb.reverse/until-reverse.exp: Same. + 2019-10-24 Tom de Vries * lib/gdb.exp (gdb_test_multiple): Add -wrap pattern flag. diff --git a/gdb/testsuite/gdb.reverse/sigall-precsave.exp b/gdb/testsuite/gdb.reverse/sigall-precsave.exp index 94ae26379f5..8584190a886 100644 --- a/gdb/testsuite/gdb.reverse/sigall-precsave.exp +++ b/gdb/testsuite/gdb.reverse/sigall-precsave.exp @@ -258,18 +258,16 @@ foreach sig $signals { } } -set kfail_pattern "Process record does not support instruction 0xfae64 at.*" -set test "run to end of main" -gdb_test_multiple "continue" $test { - -re "Breakpoint .* end of main .*$gdb_prompt $" { - pass $test +gdb_test_multiple "continue" "run to end of main" { + -wrap -re "Breakpoint .* end of main .*" { + pass $gdb_test_name } - -re "Breakpoint .* handle_.*$gdb_prompt $" { + -wrap -re "Breakpoint .* handle_.*" { send_gdb "continue\n" exp_continue } - -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" { - kfail "gdb/25038" $test + -wrap -re "Process record does not support instruction 0xfae64 at.*" { + kfail "gdb/25038" $gdb_test_name return -1 } } diff --git a/gdb/testsuite/gdb.reverse/sigall-reverse.exp b/gdb/testsuite/gdb.reverse/sigall-reverse.exp index ecebf05ed7d..a4ed639f08f 100644 --- a/gdb/testsuite/gdb.reverse/sigall-reverse.exp +++ b/gdb/testsuite/gdb.reverse/sigall-reverse.exp @@ -51,21 +51,21 @@ proc test_one_sig {nextsig} { if { $thissig == "IO" } { setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu" } - set testmsg "get signal $thissig" - set kfail_pattern "Process record does not support instruction 0xfae64 at.*" - gdb_test_multiple "continue" $testmsg { - -re "Program received signal SIG$thissig.*handle_$thissig.*$gdb_prompt $" { - fail "$testmsg (wrong location)" + gdb_test_multiple "continue" "get signal $thissig" { + -wrap -re \ + "Program received signal SIG$thissig.*handle_$thissig.*" { + fail "$gdb_test_name (wrong location)" } - -re "Program received signal SIG$thissig.*$gdb_prompt $" { - pass $testmsg + -wrap -re "Program received signal SIG$thissig.*" { + pass $gdb_test_name } - -re "Breakpoint.* handle_$thissig.*$gdb_prompt $" { - xfail $testmsg + -wrap -re "Breakpoint.* handle_$thissig.*" { + xfail $gdb_test_name set need_another_continue 0 } - -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" { - kfail "gdb/25038" "$testmsg" + -wrap -re \ + "Process record does not support instruction 0xfae64 at.*" { + kfail "gdb/25038" $gdb_test_name set record_instruction_kfail 1 return } diff --git a/gdb/testsuite/gdb.reverse/solib-precsave.exp b/gdb/testsuite/gdb.reverse/solib-precsave.exp index a3f874c09b7..165580d8a0a 100644 --- a/gdb/testsuite/gdb.reverse/solib-precsave.exp +++ b/gdb/testsuite/gdb.reverse/solib-precsave.exp @@ -91,15 +91,12 @@ gdb_test "break $end_of_main" \ "Breakpoint $decimal at .*$srcfile, line $end_of_main\." \ "breakpoint at end of main" -set test "run to end of main" -set pass_pattern "Breakpoint .* end of main .*" -set kfail_pattern "Process record does not support instruction 0xfae64 at.*" -gdb_test_multiple "continue" $test { - -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { - pass $test +gdb_test_multiple "continue" "run to end of main" { + -wrap -re "Breakpoint .* end of main .*" { + pass $gdb_test_name } - -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" { - kfail "gdb/25038" $test + -wrap -re "Process record does not support instruction 0xfae64 at.*" { + kfail "gdb/25038" $gdb_test_name return -1 } } diff --git a/gdb/testsuite/gdb.reverse/solib-reverse.exp b/gdb/testsuite/gdb.reverse/solib-reverse.exp index 53b35239f81..6d4a8a1c0c3 100644 --- a/gdb/testsuite/gdb.reverse/solib-reverse.exp +++ b/gdb/testsuite/gdb.reverse/solib-reverse.exp @@ -86,15 +86,12 @@ if [supports_process_record] { set end_part_one [gdb_get_line_number " end part one" "$srcfile"] set end_part_two [gdb_get_line_number " end part two" "$srcfile"] -set test "run until end part one" -set pass_pattern " end part one.*" -set kfail_pattern "Process record does not support instruction 0xfae64 at.*" -gdb_test_multiple "until $end_part_one" $test { - -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { - pass $test +gdb_test_multiple "until $end_part_one" "run until end part one" { + -wrap -re " end part one.*" { + pass $gdb_test_name } - -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" { - kfail "gdb/25038" $test + -wrap -re "Process record does not support instruction 0xfae64 at.*" { + kfail "gdb/25038" $gdb_test_name return -1 } } diff --git a/gdb/testsuite/gdb.reverse/until-precsave.exp b/gdb/testsuite/gdb.reverse/until-precsave.exp index 1f09df193fd..ad59a522ff7 100644 --- a/gdb/testsuite/gdb.reverse/until-precsave.exp +++ b/gdb/testsuite/gdb.reverse/until-precsave.exp @@ -50,15 +50,12 @@ gdb_test "break $end_of_main" \ # This can take awhile. with_timeout_factor 20 { - set test "run to end of main" - set pass_pattern "Breakpoint .* set breakpoint 10a here .*" - set kfail_pattern "Process record does not support instruction 0xfae64 at.*" - gdb_test_multiple "continue" $test { - -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { - pass $test + gdb_test_multiple "continue" "run to end of main" { + -wrap -re "Breakpoint .* set breakpoint 10a here .*" { + pass $gdb_test_name } - -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" { - kfail "gdb/25038" $test + -wrap -re "Process record does not support instruction 0xfae64 at.*" { + kfail "gdb/25038" $gdb_test_name return -1 } } diff --git a/gdb/testsuite/gdb.reverse/until-reverse.exp b/gdb/testsuite/gdb.reverse/until-reverse.exp index 804e07f46ca..b7ce548bfcf 100644 --- a/gdb/testsuite/gdb.reverse/until-reverse.exp +++ b/gdb/testsuite/gdb.reverse/until-reverse.exp @@ -49,15 +49,12 @@ gdb_test "until $bp_location1" \ # Advance up to factorial, outer invocation # -set test "advance to factorial" -set pass_pattern "factorial .value=6..*$srcfile:$bp_location7.*" -set kfail_pattern "Process record does not support instruction 0xfae64 at.*" -gdb_test_multiple "advance factorial" $test { - -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { - pass "$test" +gdb_test_multiple "advance factorial" "" { + -wrap -re "factorial .value=6..*$srcfile:$bp_location7.*" { + pass $gdb_test_name } - -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" { - kfail "gdb/25038" $test + -wrap -re "Process record does not support instruction 0xfae64 at.*" { + kfail "gdb/25038" $gdb_test_name return -1 } } -- 2.30.2