Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Markus Metzger via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/4] testsuite, gdb.btrace: make test names unique
Date: Thu, 17 Dec 2020 16:12:09 +0100	[thread overview]
Message-ID: <20201217151212.1179058-2-markus.t.metzger@intel.com> (raw)
In-Reply-To: <20201217151212.1179058-1-markus.t.metzger@intel.com>

gdb/testsuite/ChangeLog:
2020-12-04  Markus Metzger  <markus.t.metzger@intel.com>

	* gdb.btrace/data.exp: Make test names unique.
	* gdb.btrace/delta.exp: Likewise.
	* gdb.btrace/enable.exp: Likewise.
	* gdb.btrace/function_call_history.exp: Likewise.
	* gdb.btrace/nohist.exp: Likewise.
	* gdb.btrace/non-stop.exp: Likewise.
	* gdb.btrace/rn-dl-bind.exp: Likewise.
	* gdb.btrace/step.exp: Likewise.
	* gdb.btrace/stepi.exp: Likewise.
	* gdb.btrace/tailcall.exp: Likewise.
---
 gdb/testsuite/gdb.btrace/data.exp             |  24 ++-
 gdb/testsuite/gdb.btrace/delta.exp            |  30 ++--
 gdb/testsuite/gdb.btrace/enable.exp           |   2 +-
 .../gdb.btrace/function_call_history.exp      |   2 +-
 gdb/testsuite/gdb.btrace/nohist.exp           |   8 +-
 gdb/testsuite/gdb.btrace/non-stop.exp         |  72 +++++----
 gdb/testsuite/gdb.btrace/rn-dl-bind.exp       |  14 +-
 gdb/testsuite/gdb.btrace/step.exp             |  26 ++--
 gdb/testsuite/gdb.btrace/stepi.exp            | 146 +++++++++++-------
 gdb/testsuite/gdb.btrace/tailcall.exp         |  30 ++--
 10 files changed, 215 insertions(+), 139 deletions(-)

diff --git a/gdb/testsuite/gdb.btrace/data.exp b/gdb/testsuite/gdb.btrace/data.exp
index b10970f6760..28ac1ad46ad 100644
--- a/gdb/testsuite/gdb.btrace/data.exp
+++ b/gdb/testsuite/gdb.btrace/data.exp
@@ -40,16 +40,24 @@ gdb_test "next" ".*main\.3.*"
 gdb_test "reverse-step" ".*test\.4.*"
 
 # we can't read memory while we're replaying
-gdb_test "print glob" "unavailable\[^\\\r\\\n\]*"
-gdb_test "print loc" "unavailable\[^\\\r\\\n\]*"
+with_test_prefix "replay" {
+    with_test_prefix "default" {
+	gdb_test "print glob" "unavailable\[^\\\r\\\n\]*"
+	gdb_test "print loc" "unavailable\[^\\\r\\\n\]*"
+    }
 
-# we can read memory if we explicitly allow it.
-gdb_test_no_output "set record btrace replay-memory-access read-write"
-gdb_test "print glob" "1"
+    # we can read memory if we explicitly allow it.
+    with_test_prefix "read-write" {
+	gdb_test_no_output "set record btrace replay-memory-access read-write"
+	gdb_test "print glob" "1"
+    }
 
-# we can't if we don't explicitly allow it.
-gdb_test_no_output "set record btrace replay-memory-access read-only"
-gdb_test "print glob" "unavailable\[^\\\r\\\n\]*"
+    # we can't if we don't explicitly allow it.
+    with_test_prefix "read-only" {
+	gdb_test_no_output "set record btrace replay-memory-access read-only"
+	gdb_test "print glob" "unavailable\[^\\\r\\\n\]*"
+    }
+}
 
 # stop replaying and try again
 gdb_test "record goto end" ".*main\.3.*"
diff --git a/gdb/testsuite/gdb.btrace/delta.exp b/gdb/testsuite/gdb.btrace/delta.exp
index 0fe0e99f9ac..54891214653 100644
--- a/gdb/testsuite/gdb.btrace/delta.exp
+++ b/gdb/testsuite/gdb.btrace/delta.exp
@@ -73,18 +73,22 @@ with_test_prefix "twice" {
 }
 
 # check that we can reverse-stepi that instruction
-gdb_test "reverse-stepi"
-gdb_test "info record" [multi_line \
-  "Active record target: record-btrace" \
-  "Recording format: .*" \
-  "Recorded 1 instructions in 1 functions \\\(0 gaps\\\) for .*" \
-  "Replay in progress\.  At instruction 1\." \
-  ] "reverse-stepi"
+with_test_prefix "reverse" {
+    gdb_test "reverse-stepi"
+    gdb_test "info record" [multi_line \
+      "Active record target: record-btrace" \
+      "Recording format: .*" \
+      "Recorded 1 instructions in 1 functions \\\(0 gaps\\\) for .*" \
+      "Replay in progress\.  At instruction 1\." \
+    ]
+}
 
 # and back
-gdb_test "stepi"
-gdb_test "info record" [multi_line \
-  "Active record target: record-btrace" \
-  "Recording format: .*" \
-  "Recorded 1 instructions in 1 functions \\\(0 gaps\\\) for .*" \
-  ] "and back"
+with_test_prefix "forward" {
+    gdb_test "stepi"
+    gdb_test "info record" [multi_line \
+      "Active record target: record-btrace" \
+      "Recording format: .*" \
+      "Recorded 1 instructions in 1 functions \\\(0 gaps\\\) for .*" \
+    ]
+}
diff --git a/gdb/testsuite/gdb.btrace/enable.exp b/gdb/testsuite/gdb.btrace/enable.exp
index 8ce1dab076f..d147e90874a 100644
--- a/gdb/testsuite/gdb.btrace/enable.exp
+++ b/gdb/testsuite/gdb.btrace/enable.exp
@@ -100,7 +100,7 @@ if ![runto_main] {
     untested "failed to run to main"
     return -1
 }
-gdb_test_no_output "record btrace"
+gdb_test_no_output "record btrace" "enable after restart"
 if ![runto_main] {
     untested "failed to run to main"
     return -1
diff --git a/gdb/testsuite/gdb.btrace/function_call_history.exp b/gdb/testsuite/gdb.btrace/function_call_history.exp
index bc28ec7cccd..51536ff6035 100644
--- a/gdb/testsuite/gdb.btrace/function_call_history.exp
+++ b/gdb/testsuite/gdb.btrace/function_call_history.exp
@@ -240,7 +240,7 @@ gdb_continue_to_breakpoint "cont to fib.3"
 gdb_continue_to_breakpoint "cont to fib.4"
 
 # start tracing
-gdb_test_no_output "record btrace"
+gdb_test_no_output "record btrace" "start recording after rerun"
 
 # continue until line 30 above
 delete_breakpoints
diff --git a/gdb/testsuite/gdb.btrace/nohist.exp b/gdb/testsuite/gdb.btrace/nohist.exp
index 0273ceef815..90883c06973 100644
--- a/gdb/testsuite/gdb.btrace/nohist.exp
+++ b/gdb/testsuite/gdb.btrace/nohist.exp
@@ -42,8 +42,12 @@ proc check_not_replaying {} {
 
 gdb_test_no_output "record btrace"
 
-check_not_replaying
+with_test_prefix "forward" {
+    check_not_replaying
+}
 
 gdb_test "reverse-continue" "No more reverse-execution history\.\r\n.*"
 
-check_not_replaying
+with_test_prefix "backward" {
+    check_not_replaying
+}
diff --git a/gdb/testsuite/gdb.btrace/non-stop.exp b/gdb/testsuite/gdb.btrace/non-stop.exp
index 1637fab888a..f3bf005f9eb 100644
--- a/gdb/testsuite/gdb.btrace/non-stop.exp
+++ b/gdb/testsuite/gdb.btrace/non-stop.exp
@@ -52,7 +52,7 @@ set loop_line "$loop\[^\\\r\\\n\]*/\\\* loop \\\*/"
 
 # make sure $line matches the full expected output per thread.
 # and let's hope that GDB never mixes the output from different threads.
-proc gdb_cont_to { threads cmd line nthreads } {
+proc gdb_cont_to { threads cmd line nthreads message } {
     global gdb_prompt
     set full_cmd "thread apply $threads $cmd"
 
@@ -60,13 +60,13 @@ proc gdb_cont_to { threads cmd line nthreads } {
     # the prompt precedes any further output except some errors.
     gdb_test_multiple "$full_cmd &" "$full_cmd: prompt" {
         -re "$gdb_prompt " {
-            pass "$full_cmd: prompt"
+            pass "$full_cmd ($message): prompt"
         }
     }
 
     # now check for the expected line - one per thread.
     for {set i 0} {$i < $nthreads} {incr i} {
-        set test "$full_cmd: thread $i"
+        set test "$full_cmd ($message): thread $i"
 
         gdb_test_multiple "" $test {
             -re "$line\[^\\\r\\\n\]*\r\n" {
@@ -82,7 +82,7 @@ proc gdb_cont_to_bp_line { line threads nthreads } {
              "Breakpoint\[^\\\r\\\n\]*$line" \
              "\[^\\\r\\\n\]*" \
             ] \
-        $nthreads
+        $nthreads "to $line"
 }
 
 proc gdb_cont_to_no_history { threads cmd nthreads } {
@@ -92,7 +92,7 @@ proc gdb_cont_to_no_history { threads cmd nthreads } {
              "\[^\\\r\\\n\]*" \
              "\[^\\\r\\\n\]*" \
             ] \
-        $nthreads
+        $nthreads "to end of history"
 }
 
 # trace the code between the two breakpoints
@@ -112,15 +112,15 @@ with_test_prefix "navigate" {
     gdb_test "thread apply 1 record goto 2" "$loop_line"
     gdb_test "thread apply 2 record goto 4" "$loop_line"
     gdb_test "thread apply 1 info record" \
-        ".*Replay in progress\.  At instruction 2\."
+        ".*Replay in progress\.  At instruction 2\." "thread 1 at insn 2"
     gdb_test "thread apply 2 info record" \
-        ".*Replay in progress\.  At instruction 4\."
+        ".*Replay in progress\.  At instruction 4\." "thread 2 at insn 4"
 
     gdb_test "thread apply all record goto 5" "$loop_line"
     gdb_test "thread apply 1 info record" \
-        ".*Replay in progress\.  At instruction 5\."
+        ".*Replay in progress\.  At instruction 5\." "thread 1 at insn 5"
     gdb_test "thread apply 2 info record" \
-        ".*Replay in progress\.  At instruction 5\."
+        ".*Replay in progress\.  At instruction 5\." "thread 2 at insn 5"
 }
 
 with_test_prefix "step" {
@@ -141,7 +141,7 @@ with_test_prefix "step" {
     }
 
     with_test_prefix "all" {
-        gdb_cont_to all "stepi 4" "$loop_line" 2
+        gdb_cont_to all "stepi 4" "$loop_line" 2 "to $srcfile:$loop"
         gdb_test "thread apply 1 info record" \
             ".*Replay in progress\.  At instruction 11\."
         gdb_test "thread apply 2 info record" \
@@ -167,7 +167,7 @@ with_test_prefix "reverse-step" {
     }
 
     with_test_prefix "all" {
-        gdb_cont_to all "reverse-stepi 4" "$loop_line" 2
+        gdb_cont_to all "reverse-stepi 4" "$loop_line" 2 "to $srcfile:$loop"
         gdb_test "thread apply 1 info record" \
             ".*Replay in progress\.  At instruction 5\."
         gdb_test "thread apply 2 info record" \
@@ -177,31 +177,37 @@ with_test_prefix "reverse-step" {
 
 with_test_prefix "continue" {
     with_test_prefix "thread 1" {
-        gdb_cont_to_no_history 1 "continue" 1
-        gdb_test "thread apply 1 info record" \
-            ".*Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*"
-        gdb_test "thread apply 2 info record" \
-            ".*Replay in progress\.  At instruction 5\."
-
-        gdb_cont_to_no_history 1 "reverse-continue" 1
-        gdb_test "thread apply 1 info record" \
-            ".*Replay in progress\.  At instruction 1\."
-        gdb_test "thread apply 2 info record" \
-            ".*Replay in progress\.  At instruction 5\."
+	with_test_prefix "continue" {
+	    gdb_cont_to_no_history 1 "continue" 1
+	    gdb_test "thread apply 1 info record" \
+		".*Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*"
+	    gdb_test "thread apply 2 info record" \
+		".*Replay in progress\.  At instruction 5\."
+	}
+	with_test_prefix "reverse-continue" {
+	    gdb_cont_to_no_history 1 "reverse-continue" 1
+	    gdb_test "thread apply 1 info record" \
+		".*Replay in progress\.  At instruction 1\."
+	    gdb_test "thread apply 2 info record" \
+		".*Replay in progress\.  At instruction 5\."
+	}
     }
 
     with_test_prefix "thread 2" {
-        gdb_cont_to_no_history 2 "continue" 1
-        gdb_test "thread apply 1 info record" \
-            ".*Replay in progress\.  At instruction 1\."
-        gdb_test "thread apply 2 info record" \
-            ".*Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*"
-
-        gdb_cont_to_no_history 2 "reverse-continue" 1
-        gdb_test "thread apply 1 info record" \
-            ".*Replay in progress\.  At instruction 1\."
-        gdb_test "thread apply 2 info record" \
-            ".*Replay in progress\.  At instruction 1\."
+	with_test_prefix "continue" {
+	    gdb_cont_to_no_history 2 "continue" 1
+	    gdb_test "thread apply 1 info record" \
+		".*Replay in progress\.  At instruction 1\."
+	    gdb_test "thread apply 2 info record" \
+		".*Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*"
+	}
+	with_test_prefix "reverse-continue" {
+	    gdb_cont_to_no_history 2 "reverse-continue" 1
+	    gdb_test "thread apply 1 info record" \
+		".*Replay in progress\.  At instruction 1\."
+	    gdb_test "thread apply 2 info record" \
+		".*Replay in progress\.  At instruction 1\."
+	}
     }
 }
 
diff --git a/gdb/testsuite/gdb.btrace/rn-dl-bind.exp b/gdb/testsuite/gdb.btrace/rn-dl-bind.exp
index ab2dda413ef..46804864026 100644
--- a/gdb/testsuite/gdb.btrace/rn-dl-bind.exp
+++ b/gdb/testsuite/gdb.btrace/rn-dl-bind.exp
@@ -38,18 +38,18 @@ if ![runto_main] {
 
 # trace the code for the call to test
 gdb_test_no_output "record btrace"
-gdb_test "next" ".*main\.2.*"
+gdb_test "next" ".*main\.2.*" "next.1"
 
 # just dump the function-call-history to help debugging
 gdb_test_no_output "set record function-call-history-size 0"
 gdb_test "record function-call-history /cli 1" ".*"
 
 # check that we can reverse-next and next
-gdb_test "reverse-next" ".*main\.1.*"
-gdb_test "next" ".*main\.2.*"
+gdb_test "reverse-next" ".*main\.1.*" "reverse-next.1"
+gdb_test "next" ".*main\.2.*" "next.2"
 
 # now go into test and try to reverse-next and next over the library call
-gdb_test "reverse-step" ".*test\.3.*"
-gdb_test "reverse-step" ".*test\.2.*"
-gdb_test "reverse-next" ".*test\.1.*"
-gdb_test "next" ".*test\.2.*"
+gdb_test "reverse-step" ".*test\.3.*" "reverse-step.1"
+gdb_test "reverse-step" ".*test\.2.*" "reverse-step.2"
+gdb_test "reverse-next" ".*test\.1.*" "reverse-next.2"
+gdb_test "next" ".*test\.2.*" "next.3"
diff --git a/gdb/testsuite/gdb.btrace/step.exp b/gdb/testsuite/gdb.btrace/step.exp
index 19850256590..a71c46dde6b 100644
--- a/gdb/testsuite/gdb.btrace/step.exp
+++ b/gdb/testsuite/gdb.btrace/step.exp
@@ -33,16 +33,20 @@ if ![runto_main] {
 }
 
 # trace the call to the test function
-gdb_test_no_output "record btrace"
-gdb_test "next"
+with_test_prefix "record" {
+    gdb_test_no_output "record btrace"
+    gdb_test "next"
+}
 
 # let's step around a bit
-gdb_test "reverse-next" ".*main\.2.*"
-gdb_test "step" ".*fun4\.2.*"
-gdb_test "next" ".*fun4\.3.*"
-gdb_test "step" ".*fun2\.2.*"
-gdb_test "finish" ".*fun4\.4.*"
-gdb_test "reverse-step" ".*fun2\.3.*"
-gdb_test "reverse-finish" ".*fun4\.3.*"
-gdb_test "reverse-next" ".*fun4\.2.*"
-gdb_test "reverse-finish" ".*main\.2.*"
+with_test_prefix "replay" {
+    gdb_test "reverse-next" ".*main\.2.*" "reverse-next.1"
+    gdb_test "step" ".*fun4\.2.*" "step.1"
+    gdb_test "next" ".*fun4\.3.*" "next.1"
+    gdb_test "step" ".*fun2\.2.*" "step.2"
+    gdb_test "finish" ".*fun4\.4.*" "finish.1"
+    gdb_test "reverse-step" ".*fun2\.3.*" "reverse-step.1"
+    gdb_test "reverse-finish" ".*fun4\.3.*" "reverse-finish.1"
+    gdb_test "reverse-next" ".*fun4\.2.*" "reverse-next.2"
+    gdb_test "reverse-finish" ".*main\.2.*" "reverse-finish.2"
+}
diff --git a/gdb/testsuite/gdb.btrace/stepi.exp b/gdb/testsuite/gdb.btrace/stepi.exp
index 1ab1b9adfa1..4e2bf1a8e81 100644
--- a/gdb/testsuite/gdb.btrace/stepi.exp
+++ b/gdb/testsuite/gdb.btrace/stepi.exp
@@ -61,82 +61,122 @@ proc check_replay_at { insn } {
     ".*" \
     "Recorded 40 instructions in 16 functions \\\(0 gaps\\\) for .*" \
     "Replay in progress\.  At instruction $insn\." \
-    ]
+    ] "check replay at $insn"
 }
 
 # trace the call to the test function
-gdb_test_no_output "record btrace"
-gdb_test "next"
+with_test_prefix "record" {
+    gdb_test_no_output "record btrace"
+    gdb_test "next" ".*" "next.1"
+}
 
 # we start with stepping to make sure that the trace is fetched automatically
-gdb_test "reverse-stepi" ".*fun4\.5.*"
-gdb_test "reverse-stepi" ".*fun4\.5.*"
+with_test_prefix "fetch" {
+    gdb_test "reverse-stepi" ".*fun4\.5.*" "reverse-stepi.1"
+    gdb_test "reverse-stepi" ".*fun4\.5.*" "reverse-stepi.2"
 
-# let's check where we are in the trace
-with_test_prefix "reverse-stepi to 39" { check_replay_at 39 }
+    # let's check where we are in the trace
+    check_replay_at 39
+}
 
 # let's step forward and check again
-gdb_test "stepi" ".*fun4\.5.*"
-with_test_prefix "stepi to 40" { check_replay_at 40 }
+with_test_prefix "stepi" {
+    gdb_test "stepi" ".*fun4\.5.*"
+    check_replay_at 40
+}
 
 # with the next step, we stop replaying
-gdb_test "stepi" ".*main\.3.*"
-gdb_test "info record" [multi_line \
-  "Active record target: record-btrace" \
-  ".*" \
-  "Recorded 40 instructions in 16 functions \\\(0 gaps\\\) for \[^\\\r\\\n\]*" \
-  ] "stepi to live"
+with_test_prefix "end" {
+    gdb_test "stepi" ".*main\.3.*"
+    gdb_test "info record" [multi_line \
+      "Active record target: record-btrace" \
+      ".*" \
+      "Recorded 40 instructions in 16 functions \\\(0 gaps\\\) for \[^\\\r\\\n\]*" \
+			       ]
+}
 
 # let's try nexti
-gdb_test "reverse-nexti" ".*main\.2.*"
-with_test_prefix "reverse-nexti - 1" { check_replay_at 1 }
+with_test_prefix "reverse-nexti.1" {
+    gdb_test "reverse-nexti" ".*main\.2.*"
+    check_replay_at 1
+}
 
 # we can't reverse-nexti any further
-gdb_test "reverse-nexti" "No more reverse-execution history\.\r\n.*main\.2.*"
-with_test_prefix "reverse-nexti - 1" { check_replay_at 1 }
+with_test_prefix "reverse-nexti.2" {
+    gdb_test "reverse-nexti" \
+	"No more reverse-execution history\.\r\n.*main\.2.*" \
+	"reverse-nexti.2"
+    check_replay_at 1
+}
 
 # but we can step back again
-gdb_test "nexti" ".*main\.3.*" "next, 1.5"
-gdb_test "info record" [multi_line \
-  "Active record target: record-btrace" \
-  ".*" \
-  "Recorded 40 instructions in 16 functions \\\(0 gaps\\\) for \[^\\\r\\\n\]*" \
-  ] "nexti back"
+with_test_prefix "nexti" {
+    gdb_test "nexti" ".*main\.3.*"
+    gdb_test "info record" [multi_line \
+      "Active record target: record-btrace" \
+      ".*" \
+      "Recorded 40 instructions in 16 functions \\\(0 gaps\\\) for \[^\\\r\\\n\]*" \
+			       ]
+}
 
 # let's step from a goto position somewhere in the middle
-gdb_test "record goto 22" ".*fun3\.2.*"
-with_test_prefix "goto 22" { check_replay_at 22 }
+with_test_prefix "goto" {
+    gdb_test "record goto 22" ".*fun3\.2.*"
+    with_test_prefix "goto 22" { check_replay_at 22 }
 
-gdb_test "stepi" ".*fun1\.1.*"
-with_test_prefix "stepi to 23" { check_replay_at 23 }
+    gdb_test "stepi" ".*fun1\.1.*" "stepi.3"
+    with_test_prefix "stepi to 23" { check_replay_at 23 }
 
-gdb_test "reverse-stepi" ".*fun3\.2.*"
-with_test_prefix "reverse-stepi to 22" { check_replay_at 22 }
+    gdb_test "reverse-stepi" ".*fun3\.2.*" "reverse-stepi.3"
+    with_test_prefix "reverse-stepi to 22" { check_replay_at 22 }
 
-gdb_test "nexti" ".*fun3\.3.*"
-with_test_prefix "nexti to 27" { check_replay_at 27 }
+    gdb_test "nexti" ".*fun3\.3.*"
+    with_test_prefix "nexti to 27" { check_replay_at 27 }
 
-gdb_test "reverse-nexti" ".*fun3\.2.*"
-with_test_prefix "reverse-nexti to 22" { check_replay_at 22 }
+    gdb_test "reverse-nexti" ".*fun3\.2.*" "reverse-nexti.3"
+    with_test_prefix "reverse-nexti to 22" { check_replay_at 22 }
+}
 
 # let's try to step off the left end
-gdb_test "record goto begin" ".*main\.2.*"
-with_test_prefix "goto begin" { check_replay_at 1 }
-
-gdb_test "reverse-stepi" "No more reverse-execution history\.\r\n.*main\.2.*"
-gdb_test "reverse-stepi" "No more reverse-execution history\.\r\n.*main\.2.*"
-with_test_prefix "reverse-stepi at begin" { check_replay_at 1 }
-
-gdb_test "reverse-nexti" "No more reverse-execution history\.\r\n.*main\.2.*"
-gdb_test "reverse-nexti" "No more reverse-execution history\.\r\n.*main\.2.*"
-with_test_prefix "reverse-nexti at begin" { check_replay_at 1 }
-
-# we can step forward, though
-gdb_test "stepi" ".*fun4\.1.*"
-with_test_prefix "stepi to 2" { check_replay_at 2 }
+with_test_prefix "goto begin" {
+    gdb_test "record goto begin" ".*main\.2.*"
+    check_replay_at 1
+
+    with_test_prefix "reverse-stepi" {
+	gdb_test "reverse-stepi" \
+	    "No more reverse-execution history\.\r\n.*main\.2.*" \
+	    "reverse-stepi.1"
+	gdb_test "reverse-stepi" \
+	    "No more reverse-execution history\.\r\n.*main\.2.*" \
+	    "reverse-stepi.2"
+	check_replay_at 1
+    }
+
+    with_test_prefix "reverse-nexti" {
+	gdb_test "reverse-nexti" \
+	    "No more reverse-execution history\.\r\n.*main\.2.*" \
+	    "reverse-nexti.1"
+	gdb_test "reverse-nexti" \
+	    "No more reverse-execution history\.\r\n.*main\.2.*" \
+	    "reverse-nexti.2"
+	check_replay_at 1
+    }
+
+    # we can step forward, though
+    with_test_prefix "stepi" {
+	gdb_test "stepi" ".*fun4\.1.*"
+	check_replay_at 2
+    }
+}
 
 # let's try to step off the left end again
-gdb_test "reverse-stepi" ".*main\.2.*"
-gdb_test "reverse-stepi" "No more reverse-execution history\.\r\n.*main\.2.*"
-gdb_test "reverse-stepi" "No more reverse-execution history\.\r\n.*main\.2.*"
-with_test_prefix "reverse-stepi at begin" { check_replay_at 1 }
+with_test_prefix "reverse-stepi" {
+    gdb_test "reverse-stepi" ".*main\.2.*" "reverse-stepi.1"
+    gdb_test "reverse-stepi" \
+	"No more reverse-execution history\.\r\n.*main\.2.*" \
+	"reverse-stepi.2"
+    gdb_test "reverse-stepi" \
+	"No more reverse-execution history\.\r\n.*main\.2.*" \
+	"reverse-stepi.3"
+    check_replay_at 1
+}
diff --git a/gdb/testsuite/gdb.btrace/tailcall.exp b/gdb/testsuite/gdb.btrace/tailcall.exp
index 2937a3b4fe9..4f86a6f2088 100644
--- a/gdb/testsuite/gdb.btrace/tailcall.exp
+++ b/gdb/testsuite/gdb.btrace/tailcall.exp
@@ -93,13 +93,23 @@ gdb_test "up" "#2\[^\r\n\]*main \\(\\) at tailcall.c:37\r\n.*" "up to main"
 gdb_test "down" "#1\[^\r\n\]*foo \\(\\) at tailcall.c:29\r\n.*" "down to foo"
 
 # test stepping into and out of tailcalls.
-gdb_test "finish" "\[^\r\n\]*main \\(\\) at tailcall.c:38\r\n.*"
-gdb_test "reverse-step" "\[^\r\n\]*bar \\(\\) at tailcall.c:24\r\n.*"
-gdb_test "reverse-finish" "\[^\r\n\]*foo \\(\\) at tailcall.c:29\r\n.*"
-gdb_test "reverse-step" "\[^\r\n\]*main \\(\\) at tailcall.c:37\r\n.*"
-gdb_test "next" "\[^\r\n\]*38.*"
-gdb_test "reverse-next" "\[^\r\n\]*main \\(\\) at tailcall.c:37\r\n.*"
-gdb_test "step" "\[^\r\n\]*foo \\(\\) at tailcall.c:29\r\n.*"
-gdb_test "finish" "\[^\r\n\]*main \\(\\) at tailcall.c:38\r\n.*"
-gdb_test "reverse-step" "\[^\r\n\]*bar \\(\\) at tailcall.c:24\r\n.*"
-gdb_test "finish" "\[^\r\n\]*main \\(\\) at tailcall.c:38\r\n.*"
+gdb_test "finish" "\[^\r\n\]*main \\(\\) at tailcall.c:38\r\n.*" \
+    "finish.1"
+gdb_test "reverse-step" "\[^\r\n\]*bar \\(\\) at tailcall.c:24\r\n.*" \
+    "reverse-step.1"
+gdb_test "reverse-finish" "\[^\r\n\]*foo \\(\\) at tailcall.c:29\r\n.*" \
+    "reverse-finish.1"
+gdb_test "reverse-step" "\[^\r\n\]*main \\(\\) at tailcall.c:37\r\n.*" \
+    "reverse-step.2"
+gdb_test "next" "\[^\r\n\]*38.*" \
+    "next.1"
+gdb_test "reverse-next" "\[^\r\n\]*main \\(\\) at tailcall.c:37\r\n.*" \
+    "reverse-next.1"
+gdb_test "step" "\[^\r\n\]*foo \\(\\) at tailcall.c:29\r\n.*" \
+    "step.1"
+gdb_test "finish" "\[^\r\n\]*main \\(\\) at tailcall.c:38\r\n.*" \
+    "finish.2"
+gdb_test "reverse-step" "\[^\r\n\]*bar \\(\\) at tailcall.c:24\r\n.*" \
+    "reverse-step.3"
+gdb_test "finish" "\[^\r\n\]*main \\(\\) at tailcall.c:38\r\n.*" \
+    "finish.3"
-- 
2.26.2

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


  reply	other threads:[~2020-12-17 15:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 15:12 [PATCH] gdb, record: rephrase the 'not recording' error message Markus Metzger via Gdb-patches
2020-12-17 15:12 ` Markus Metzger via Gdb-patches [this message]
2020-12-18 19:34   ` [PATCH 1/4] testsuite, gdb.btrace: make test names unique Simon Marchi via Gdb-patches
2020-12-21  7:26     ` Metzger, Markus T via Gdb-patches
2020-12-17 15:12 ` [PATCH 2/4] testsuite, gdb.python: make py-record-*.exp " Markus Metzger via Gdb-patches
2020-12-18 19:35   ` Simon Marchi via Gdb-patches
2020-12-17 15:12 ` [PATCH 3/4] testsuite, gdb.btrace: skip multi-inferior.exp on gdbserver targets Markus Metzger via Gdb-patches
2020-12-18 19:49   ` Simon Marchi via Gdb-patches
2020-12-21  7:27     ` Metzger, Markus T via Gdb-patches
2020-12-21 13:50       ` Simon Marchi via Gdb-patches
2020-12-17 15:12 ` [PATCH 4/4] testsuite, gdb.btrace: fix 32-bit PIE false positives Markus Metzger via Gdb-patches
2020-12-18 20:01   ` Simon Marchi via Gdb-patches
2020-12-21  7:27     ` Metzger, Markus T via Gdb-patches
2020-12-18 19:18 ` [PATCH] gdb, record: rephrase the 'not recording' error message Simon Marchi 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=20201217151212.1179058-2-markus.t.metzger@intel.com \
    --to=gdb-patches@sourceware.org \
    --cc=markus.t.metzger@intel.com \
    /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