gdb/testsuite: Make test names unique in gdb.reverse tests
authorAndrew Burgess <andrew.burgess@embecosm.com>
Sun, 15 Sep 2019 17:21:32 +0000 (13:21 -0400)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 3 Oct 2019 16:48:02 +0000 (17:48 +0100)
Make test names unique in the gdb.reverse tests.  On my local machine
this removed 825 duplicate test names.  It is possible that different
setups might still encounter some duplicates.

gdb/testsuite/ChangeLog:

* gdb.reverse/break-precsave.exp: Make test names unique.
* gdb.reverse/break-reverse.exp: Likewise.
* gdb.reverse/finish-precsave.exp: Likewise.
* gdb.reverse/finish-reverse.exp: Likewise.
* gdb.reverse/machinestate-precsave.exp: Likewise.
* gdb.reverse/machinestate.exp: Likewise.
* gdb.reverse/readv-reverse.exp: Likewise.
* gdb.reverse/recvmsg-reverse.exp: Likewise.
* gdb.reverse/sigall-precsave.exp: Likewise.
* gdb.reverse/sigall-reverse.exp: Likewise.
* gdb.reverse/step-indirect-call-thunk.exp: Likewise.
* gdb.reverse/watch-precsave.exp: Likewise.
* gdb.reverse/watch-reverse.exp: Likewise.

14 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.reverse/break-precsave.exp
gdb/testsuite/gdb.reverse/break-reverse.exp
gdb/testsuite/gdb.reverse/finish-precsave.exp
gdb/testsuite/gdb.reverse/finish-reverse.exp
gdb/testsuite/gdb.reverse/machinestate-precsave.exp
gdb/testsuite/gdb.reverse/machinestate.exp
gdb/testsuite/gdb.reverse/readv-reverse.exp
gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
gdb/testsuite/gdb.reverse/sigall-precsave.exp
gdb/testsuite/gdb.reverse/sigall-reverse.exp
gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp
gdb/testsuite/gdb.reverse/watch-precsave.exp
gdb/testsuite/gdb.reverse/watch-reverse.exp

index 867db0539250916be8ce5f9327b44efa7ed4c9af..b78d16f81714b18ec9ec62cf71320c4a56716e87 100644 (file)
@@ -1,3 +1,19 @@
+2019-10-03  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * gdb.reverse/break-precsave.exp: Make test names unique.
+       * gdb.reverse/break-reverse.exp: Likewise.
+       * gdb.reverse/finish-precsave.exp: Likewise.
+       * gdb.reverse/finish-reverse.exp: Likewise.
+       * gdb.reverse/machinestate-precsave.exp: Likewise.
+       * gdb.reverse/machinestate.exp: Likewise.
+       * gdb.reverse/readv-reverse.exp: Likewise.
+       * gdb.reverse/recvmsg-reverse.exp: Likewise.
+       * gdb.reverse/sigall-precsave.exp: Likewise.
+       * gdb.reverse/sigall-reverse.exp: Likewise.
+       * gdb.reverse/step-indirect-call-thunk.exp: Likewise.
+       * gdb.reverse/watch-precsave.exp: Likewise.
+       * gdb.reverse/watch-reverse.exp: Likewise.
+
 2019-10-03  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * gdb.threads/stop-with-handle.c: New file.
index 68ac35db53e254541a8d2a52669dad7e736cb345..085526b88f6036fe027109a820f4f8c0ddc1e10c 100644 (file)
@@ -69,8 +69,10 @@ proc precsave_tests {} {
        "Breakpoint $decimal at .* line $bar_location\." \
        "set breakpoint on bar"
 
-    gdb_continue_to_breakpoint "foo" ".*$srcfile:$foo_location.*"
-    gdb_continue_to_breakpoint "bar" ".*$srcfile:$bar_location.*"
+    gdb_continue_to_breakpoint "foo forward after restore" \
+       ".*$srcfile:$foo_location.*"
+    gdb_continue_to_breakpoint "bar forward after restore" \
+       ".*$srcfile:$bar_location.*"
     gdb_test_multiple "continue" "go to end of main forward" {
        -re ".*Breakpoint $decimal,.*$srcfile:$end_location.*$gdb_prompt $"  {
            pass "go to end of main forward"
@@ -96,8 +98,10 @@ proc precsave_tests {} {
 
     gdb_test_no_output "set exec-direction forward" "set forward"
 
-    gdb_continue_to_breakpoint "foo" ".*$srcfile:$foo_location.*"
-    gdb_continue_to_breakpoint "bar" ".*$srcfile:$bar_location.*"
+    gdb_continue_to_breakpoint "foo forward again" \
+       ".*$srcfile:$foo_location.*"
+    gdb_continue_to_breakpoint "bar forward again" \
+       ".*$srcfile:$bar_location.*"
 
     gdb_test_multiple "continue" "end of record log" {
        -re ".*Breakpoint $decimal,.*$srcfile:$end_location.*$gdb_prompt $" {
index c1242c8d4a365b3fb93a612965aa1563f56659ba..602b6e6317a9058d8dd5de8fa659c2e50d7fb2be 100644 (file)
@@ -50,9 +50,12 @@ gdb_test "break $end_location" \
     "Breakpoint $decimal at .* line $end_location\." \
     "set breakpoint at end of main"
 
-gdb_continue_to_breakpoint "foo" ".*$srcfile:$foo_location.*"
-gdb_continue_to_breakpoint "bar" ".*$srcfile:$bar_location.*"
-gdb_continue_to_breakpoint "end" ".*$srcfile:$end_location.*"
+gdb_continue_to_breakpoint "foo forward, the first time" \
+    ".*$srcfile:$foo_location.*"
+gdb_continue_to_breakpoint "bar forward, the first time" \
+    ".*$srcfile:$bar_location.*"
+gdb_continue_to_breakpoint "end forward, the first time" \
+    ".*$srcfile:$end_location.*"
 
 gdb_test_no_output "set exec-direction reverse" "set reverse"
 
@@ -70,8 +73,10 @@ gdb_test_multiple "continue" "main backward" {
 
 gdb_test_no_output "set exec-direction forward" "set forward"
 
-gdb_continue_to_breakpoint "foo" ".*$srcfile:$foo_location.*"
-gdb_continue_to_breakpoint "bar" ".*$srcfile:$bar_location.*"
+gdb_continue_to_breakpoint "foo forward again" \
+    ".*$srcfile:$foo_location.*"
+gdb_continue_to_breakpoint "bar forward again" \
+    ".*$srcfile:$bar_location.*"
 
 gdb_test_multiple "continue" "end of record log" {
     -re ".*Breakpoint $decimal,.*$srcfile:$end_location.*$gdb_prompt $" {
index d2a683751ab577e1b15865c575156cdfd58d3b0b..a83decf7a22d1f5fc9090765993d8c6522854ba7 100644 (file)
@@ -179,7 +179,8 @@ gdb_test_no_output "set exec-dir reverse" "set reverse execution"
 # Test reverse finish from long long func
 
 set breakloc [gdb_get_line_number "LONG LONG FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "long_long_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "long_long_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from long_long_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -191,7 +192,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from long func
 
 set breakloc [gdb_get_line_number "LONG FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "long_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "long_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from long_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -203,7 +205,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from int func
 
 set breakloc [gdb_get_line_number "INT FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "int_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "int_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from int_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -215,7 +218,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from short func
 
 set breakloc [gdb_get_line_number "SHORT FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "short_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "short_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from short_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -227,7 +231,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from char func
 
 set breakloc [gdb_get_line_number "CHAR FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "char_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "char_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from char_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -239,7 +244,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from void func
 
 set breakloc [gdb_get_line_number "VOID FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "void_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "void_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from void_func"
 gdb_test_multiple "finish" "$test_msg" {
index 73eb2875b615779c7bfc642dff99d44b3a525473..88bf4cb19b451311e37066e3d76afaeb8ffd3c59 100644 (file)
@@ -158,7 +158,8 @@ gdb_test_no_output "set exec-dir reverse" "set reverse execution"
 # Test reverse finish from long long func
 
 set breakloc [gdb_get_line_number "LONG LONG FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "long_long_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "long_long_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from long_long_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -170,7 +171,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from long func
 
 set breakloc [gdb_get_line_number "LONG FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "long_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "long_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from long_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -182,7 +184,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from int func
 
 set breakloc [gdb_get_line_number "INT FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "int_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "int_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from int_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -194,7 +197,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from short func
 
 set breakloc [gdb_get_line_number "SHORT FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "short_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "short_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from short_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -206,7 +210,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from char func
 
 set breakloc [gdb_get_line_number "CHAR FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "char_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "char_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from char_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -218,7 +223,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from void func
 
 set breakloc [gdb_get_line_number "VOID FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "void_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "void_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from void_func"
 gdb_test_multiple "finish" "$test_msg" {
index a0df7c1d3f094acc931a317aece98b55458b556f..73e02a939ff00d7a34d62a91b3aae5ad5650133c 100644 (file)
@@ -167,7 +167,8 @@ gdb_test "reverse-continue" ".*$srcfile:$breakloc.*" "reverse to $breakloc"
 
 gdb_test "print a"      ".* = 0$newline"  "register var reverse-breakpoint"
 gdb_test "step"         ".* register post-change .*" ""
-gdb_test "print a"      ".* = 1$newline"  "register var step post-change"
+gdb_test "print a"      ".* = 1$newline"  \
+    "register var step post-change, first time"
 gdb_test "reverse-step" ".*$newline$breakloc.*" ""
 gdb_test "print a"      ".* = 0$newline"  "register var reverse step-to"
 
@@ -191,7 +192,8 @@ gdb_test "reverse-step" ".*hide.*" ""
 gdb_test "step"         ".*$newline$breakloc.*" ""
 gdb_test "print a"      ".* = 0$newline"  "register var forward step-to"
 gdb_test "step"         ".* register post-change .*" ""
-gdb_test "print a"      ".* = 1$newline"  "register var step post-change"
+gdb_test "print a"      ".* = 1$newline" \
+    "register var step post-change, second time"
 
 # Auto variable, forward
 
index ed65db14406ba17c2dfcc1cd477a9ad74092ed41..623498f07ac40e8aa72465f4af029d1ef7b1e4c5 100644 (file)
@@ -142,7 +142,8 @@ gdb_test "print a"      ".* = 0$newline"  "register var reverse-breakpoint"
 gdb_test "step"         ".* register post-change .*" ""
 gdb_test "print a"      ".* = 1$newline"  "register var step post-change"
 gdb_test "reverse-step" ".*$newline$breakloc.*" ""
-gdb_test "print a"      ".* = 0$newline"  "register var reverse step-to"
+gdb_test "print a"      ".* = 0$newline"  \
+    "register var reverse step-to, first time"
 
 # Proceed to beginning of main
 
@@ -164,7 +165,8 @@ gdb_test "reverse-step" ".*hide.*" ""
 gdb_test "step"         ".*$newline$breakloc.*" ""
 gdb_test "print a"      ".* = 0$newline"  "register var forward step-to"
 gdb_test "step"         ".* register post-change .*" ""
-gdb_test "print a"      ".* = 1$newline"  "register var step post-change"
+gdb_test "print a"      ".* = 1$newline"  \
+    "register var step post-change, second time"
 
 # Auto variable, forward
 
index 19ad423a412ca1d2ad7463a4199c1607b7be18a0..2f16c5cad8c0eaa644758b664f6444011525a6ed 100644 (file)
@@ -52,7 +52,7 @@ gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
 # will be remembered.  If not, new contents ("NUXI") will be
 # used, and the test will fail.
 
-gdb_test "print (int)buf\[0]" ".* = 0" "check readv record"
-gdb_test "print (int)buf\[1]" ".* = 0" "check readv record"
-gdb_test "print (int)buf\[2]" ".* = 0" "check readv record"
-gdb_test "print (int)buf\[3]" ".* = 0" "check readv record"
+for { set i 0 } { $i < 4 } { incr i } {
+    gdb_test "print (int)buf\[$i]" ".* = 0" \
+       "check readv record for buf\[$i\]"
+}
index 724927fe6c2b2d2bac97f15f586e90a8093ff353..9eea3e75ede30d0804472483a64b2fe1b4201e2f 100644 (file)
@@ -55,11 +55,13 @@ gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
 gdb_test "print rdata" ".* = \"xxxx\"" "check recvmsg record - rdata"
 
 # rmsg.msg_flags should be zeros, not MSG_TRUNC | MSG_CTRUNC
-gdb_test "print rmsg.msg_flags" ".* = 0" "check recvmsg record - rmsg"
+gdb_test "print rmsg.msg_flags" ".* = 0" \
+    "check recvmsg record - rmsg.msg_flags"
 
 # rmsg.msg_controllen should be sizeof rc, not actual size of control data
 # (7 bytes less)
-gdb_test "print rmsg.msg_controllen - sizeof rc" ".* = 0" "check recvmsg record - rmsg"
+gdb_test "print rmsg.msg_controllen - sizeof rc" ".* = 0" \
+    "check recvmsg record - rmsg.msg_controllen"
 
 # rc should be zeros, not received cmsg
 gdb_test "print ((struct cmsghdr *)rc)->cmsg_len" ".* = 0" "check recvmsg record - cmsg"
index 79a1e7282b6461b46752f562223d4fc92355898a..371eecd711029ded7a2d6294e80b2fbb0e6a1e94 100644 (file)
@@ -117,7 +117,7 @@ proc test_one_sig_reverse {prevsig} {
        -re "Program received signal SIG$prevsig.*$gdb_prompt " {
            pass "reverse to signal event, $prevsig"
 
-           set nested_testmsg "reverse signal delivered"
+           set nested_testmsg "reverse signal $prevsig delivered"
            gdb_test_multiple "frame" $nested_testmsg {
                -re ".*handle_$prevsig.*$gdb_prompt " {
                    fail "$nested_testmsg (wrong location)"
@@ -289,8 +289,10 @@ set sig_supported 1
 set thissig "ABRT"
 
 # test signal handling
-foreach sig [lrange $signals 1 end] {
-    test_one_sig $sig
+with_test_prefix "sig-test-1" {
+    foreach sig [lrange $signals 1 end] {
+       test_one_sig $sig
+    }
 }
 
 # The last signal (SIGTERM) gets handled slightly differently because
@@ -313,6 +315,8 @@ foreach sig [lreverse $signals] {
 set sig_supported 1
 set thissig "ABRT"
 
-foreach sig [lrange $signals 1 end] {
-    test_one_sig $sig
+with_test_prefix "sig-test-2" {
+    foreach sig [lrange $signals 1 end] {
+       test_one_sig $sig
+    }
 }
index c734fe8e17a6b51ded2c236e762e97eaeffae5a7..651e14d9eed391d24535d56d51d6bc8b228dd12a 100644 (file)
@@ -116,7 +116,7 @@ proc test_one_sig_reverse {prevsig} {
        -re "Program received signal SIG$prevsig.*$gdb_prompt " {
            pass "reverse to signal event, $prevsig"
 
-           set nested_testmsg "reverse signal delivered"
+           set nested_testmsg "reverse signal $prevsig delivered"
            gdb_test_multiple "frame" $nested_testmsg {
                -re ".*handle_$prevsig.*$gdb_prompt " {
                    fail "$nested_testmsg (wrong location)"
@@ -237,8 +237,10 @@ set sig_supported 1
 set thissig "ABRT"
 
 # test signal handling
-foreach sig [lrange $signals 1 end] {
-    test_one_sig $sig
+with_test_prefix "sig-test-1" {
+    foreach sig [lrange $signals 1 end] {
+       test_one_sig $sig
+    }
 }
 
 # The last signal (SIGTERM) gets handled slightly differently because
@@ -265,6 +267,8 @@ foreach sig [lreverse $signals] {
 set sig_supported 1
 set thissig "ABRT"
 
-foreach sig [lrange $signals 1 end] {
-    test_one_sig $sig
+with_test_prefix "sig-test-2" {
+    foreach sig [lrange $signals 1 end] {
+       test_one_sig $sig
+    }
 }
index 2c6cbe95318065a5576db39c17efe91d48b755fb..aa1a4f3561efe46d54d2b4f935b3d3c35d842064 100644 (file)
@@ -72,12 +72,12 @@ gdb_test "reverse-step" "apply\.3.*" "reverse-step into apply"
 gdb_test "reverse-step" "inc\.3.*" "reverse-step into inc"
 gdb_test "reverse-step" "inc\.2.*" "reverse-step inside inc"
 gdb_test "reverse-step" "apply\.2.*" \
-    "reverse-step through call thunk into apply"
+    "reverse-step through call thunk into apply, first time"
 gdb_test "reverse-step" "main\.2.*" "reverse-step into main"
 gdb_test "step" "apply\.2.*" "step into apply"
 gdb_test "step" "inc\.2.*" "step through call thunk into inc"
 gdb_test "reverse-step" "apply\.2.*" \
-    "reverse-step through call thunk into apply"
+    "reverse-step through call thunk into apply, second time"
 gdb_test "next" "apply\.3.*" "step through thunks and over inc"
 gdb_test "reverse-next" "apply\.2.*" \
     "reverse-step through thunks and over inc"
index 6ba381fb49e97219a0ed25f5902586b442a95cc9..f49a8df76f81007c0c3cec6cf1cc9c76c52f4011 100644 (file)
@@ -108,7 +108,8 @@ gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
 ###
 ###
 
-gdb_test_no_output "set exec-direction reverse" "set reverse"
+gdb_test_no_output "set exec-direction reverse" \
+    "set reverse, first time"
 
 # Reverse until the previous change, from 4 to 3
 # Note that this one is outside the loop
@@ -183,7 +184,8 @@ gdb_test "continue" "marker2 .*" "replay forward to marker2"
 ###
 ###
 
-gdb_test_no_output "set exec-direction reverse" "set reverse"
+gdb_test_no_output "set exec-direction reverse" \
+    "set reverse, second time"
 
 # Reverse until the previous change, from 4 to 3
 # Note that this one is outside the loop
index 4cc04e81e9e6f83ebc3b91be01349b086135cf23..9e866dfdd53440035aa6588ccb91d8a5d133a2c9 100644 (file)
@@ -89,7 +89,8 @@ gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
 ###
 ###
 
-gdb_test_no_output "set exec-direction reverse" "set reverse"
+gdb_test_no_output "set exec-direction reverse" \
+    "set reverse, first time"
 
 # Reverse until the previous change, from 4 to 3
 # Note that this one is outside the loop
@@ -164,7 +165,8 @@ gdb_test "continue" "marker2 .*" "replay forward to marker2"
 ###
 ###
 
-gdb_test_no_output "set exec-direction reverse" "set reverse"
+gdb_test_no_output "set exec-direction reverse" \
+    "set reverse, second time"
 
 # Reverse until the previous change, from 4 to 3
 # Note that this one is outside the loop