[PATCH 1/4] Use gdb_test_sequence to test "info tracepoints"

Yao Qi
2013-09-17T13:07:39Z

This patch replaces 'gdb_test' with 'gdb_test_sequence' to match the
output of "info tracepoints", which has multiple lines. With this
patch, these tests become more readable.

On the other hand, these tests have an assumption that there is one
"\r" at the end of the line, shown as below,

gdb_test "info tracepoints" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
^^^
\[\t \]+not installed on target." \
^^
"5.12: set a tracepoint, stepcount is zero"

The period is to match "\r" in the output. However, when running mingw32
native GDB, the end-of-line becomes "\r\r\n", so the single period in
the pattern can't match. Replacing with 'gdb_test_sequence' get rid
of this assumption, and these tests pass on mingw32 as a result. On
the other hand, it is easier to maintain the cases using
'gdb_test_sequence', IMO.

gdb/testsuite:

2013-09-17 Yao Qi <yao@codesourcery.com>

* gdb.trace/actions.exp: Use proc gdb_test_sequence to test
"info tracepoints".
* gdb.trace/infotrace.exp: Likewise.
* gdb.trace/passcount.exp: Likewise.
* gdb.trace/while-stepping.exp: Likewise.
---
gdb/testsuite/gdb.trace/actions.exp | 119 +++++++++--------
gdb/testsuite/gdb.trace/deltrace.exp | 78 ++++++------
gdb/testsuite/gdb.trace/infotrace.exp | 36 +++---
gdb/testsuite/gdb.trace/passcount.exp | 200 ++++++++++++++-------------
gdb/testsuite/gdb.trace/while-stepping.exp | 23 ++--
5 files changed, 237 insertions(+), 219 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/actions.exp b/gdb/testsuite/gdb.trace/actions.exp
index becfc4c..86a53da 100644
--- a/gdb/testsuite/gdb.trace/actions.exp
+++ b/gdb/testsuite/gdb.trace/actions.exp
@@ -76,49 +76,52 @@ gdb_trace_setactions "5.1b: set actions for first tracepoint" \
"$trcpt1" \
"collect gdb_char_test" "^$"

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_char_test.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
- "5.1c: verify actions set for first tracepoint"
+gdb_test_sequence "info tracepoints" \
+ "5.1c: verify actions set for first tracepoint" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\] collect gdb_char_test"
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]2 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]3 tracepoint keep y.* in gdb_recursion_test at "
+ "\[\r\n\]\tnot installed on target"
+ }

gdb_trace_setactions "5.1d: set actions for second tracepoint" \
"$trcpt2" \
"collect gdb_short_test" "^$"

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_char_test.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_short_test.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
- "5.1e: verify actions set for second tracepoint"
+gdb_test_sequence "info tracepoints" \
+ "5.1e: verify actions set for second tracepoint" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\] collect gdb_char_test"
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]2 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n\] collect gdb_short_test"
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]3 tracepoint keep y.* in gdb_recursion_test at "
+ "\[\r\n\]\tnot installed on target"
+ }

gdb_trace_setactions "5.2a: set actions for last (default) tracepoint" \
"" \
"collect gdb_long_test" "^$"

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_char_test.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_short_test.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_long_test.
-\[\t \]+not installed on target." \
- "5.2b: verify actions set for second tracepoint"
+gdb_test_sequence "info tracepoints" \
+ "5.2b: verify actions set for second tracepoint" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\] collect gdb_char_test"
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]2 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n\] collect gdb_short_test"
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]3 tracepoint keep y.* in gdb_recursion_test at "
+ "\[\r\n\] collect gdb_long_test"
+ "\[\r\n\]\tnot installed on target"
+ }

# 5.3 replace actions set earlier

@@ -126,18 +129,19 @@ gdb_trace_setactions "5.3a: reset actions for first tracepoint" \
"$trcpt1" \
"collect gdb_struct1_test" "^$"

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_struct1_test.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_short_test.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_long_test.
-\[\t \]+not installed on target." \
- "5.3b: verify actions set for first tracepoint"
+gdb_test_sequence "info tracepoints" \
+ "5.3b: verify actions set for first tracepoint" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\] collect gdb_struct1_test"
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]2 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n\] collect gdb_short_test"
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]3 tracepoint keep y.* in gdb_recursion_test at "
+ "\[\r\n\] collect gdb_long_test"
+ "\[\r\n\]\tnot installed on target"
+ }

#
# test end command (all by itself)
@@ -222,18 +226,19 @@ gdb_trace_setactions "5.10a: set teval action for second tracepoint" \
"$trcpt2" \
"teval \$tsv += 1" "^$"

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+teval gdb_char_test.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+teval \\\$tsv \\\+= 1.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_long_test.
-\[\t \]+not installed on target." \
- "5.10a: verify teval actions set for two tracepoints"
+gdb_test_sequence "info tracepoints" \
+ "5.10a: verify teval actions set for two tracepoints" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\] teval gdb_char_test"
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]2 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n\] teval \\\$tsv \\\+= 1"
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]3 tracepoint keep y.* in gdb_recursion_test at "
+ "\[\r\n\] collect gdb_long_test"
+ "\[\r\n\]\tnot installed on target"
+ }

gdb_test "break main"
gdb_run_cmd
diff --git a/gdb/testsuite/gdb.trace/deltrace.exp b/gdb/testsuite/gdb.trace/deltrace.exp
index 1053629..f89332d 100644
--- a/gdb/testsuite/gdb.trace/deltrace.exp
+++ b/gdb/testsuite/gdb.trace/deltrace.exp
@@ -53,15 +53,15 @@ gdb_test "trace gdb_c_test" "Tracepoint \[0-9\]+ at .*" "set tracepoint 1"
gdb_test "trace gdb_asm_test" "Tracepoint \[0-9\]+ at .*" "set tracepoint 2"
gdb_test "trace $testline1" "Tracepoint \[0-9\]+ at .*" "set tracepoint 3"

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
- "3.1a: set three tracepoints"
+gdb_test_sequence "info tracepoints" "3.1a: set three tracepoints" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y .* in gdb_c_test at "
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]2 tracepoint keep y .* in gdb_asm_test at "
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]3 tracepoint keep y .* in gdb_recursion_test at "
+ "\[\r\n\]\tnot installed on target"
+}

gdb_test "delete tracepoints" \
"" \
@@ -80,15 +80,15 @@ if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {
return
}

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
- "3.2a: set three tracepoints"
+gdb_test_sequence "info tracepoints" "3.2a: set three tracepoints" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]4 tracepoint keep y .* in gdb_c_test at "
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]5 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]6 tracepoint keep y.* in gdb_recursion_test at "
+ "\[\r\n\]\tnot installed on target"
+}

#gdb_test_no_output "delete tracepoint $trcpt1" ""
gdb_test_multiple "delete tracepoint $trcpt1" "3.2b: delete first tracepoint" {
@@ -103,13 +103,13 @@ gdb_test_multiple "delete tracepoint $trcpt1" "3.2b: delete first tracepoint" {
}
}

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
- "3.2c: verify delete first tracepoint"
+gdb_test_sequence "info tracepoints" "3.2c: verify delete first tracepoint" {
+ "Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]5 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n]\tnot installed on target"
+ "\[\r\n\]6 tracepoint keep y.* in gdb_recursion_test at "
+ "\[\r\n]\tnot installed on target"
+}

#gdb_test_no_output "delete tracepoint $trcpt2" ""
gdb_test_multiple "delete tracepoint $trcpt2" "3.2d: delete second tracepoint" {
@@ -124,11 +124,11 @@ gdb_test_multiple "delete tracepoint $trcpt2" "3.2d: delete second tracepoint" {
}
}

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
- "3.2e: verify delete second tracepoint"
+gdb_test_sequence "info tracepoints" "3.2e: verify delete second tracepoint" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]6 tracepoint keep y.* in gdb_recursion_test at "
+ "\[\r\n\]\tnot installed on target"
+}

#gdb_test_no_output "delete tracepoint $trcpt3" ""
gdb_test_multiple "delete tracepoint $trcpt3" "3.2f: delete third tracepoint" {
@@ -158,15 +158,15 @@ if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {
return
}

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
- "3.3a: set three tracepoints"
+gdb_test_sequence "info tracepoints" "3.3a: set three tracepoints" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]7 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]8 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]9 tracepoint keep y.* in gdb_recursion_test at "
+ "\[\r\n\]\tnot installed on target"
+}

#gdb_test_no_output "delete tracepoint $trcpt1 $trcpt2 $trcpt3" ""
gdb_test_multiple "delete tracepoint $trcpt1 $trcpt2 $trcpt3" \
diff --git a/gdb/testsuite/gdb.trace/infotrace.exp b/gdb/testsuite/gdb.trace/infotrace.exp
index 3a586cd..0cd168e 100644
--- a/gdb/testsuite/gdb.trace/infotrace.exp
+++ b/gdb/testsuite/gdb.trace/infotrace.exp
@@ -47,26 +47,28 @@ if { $c_test_num <= 0 || $asm_test_num <= 0 } then {
}

# 2.1 info tracepoints (all)
-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
- "2.1: info tracepoints (all)"
+gdb_test_sequence "info tracepoints" "2.1: info tracepoints (all)" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]2 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n\]\tnot installed on target"
+}

# 2.2 info tracepoint (specific)
-gdb_test "info tracepoint $c_test_num" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
- "2.2a: info tracepoint $c_test_num (gdb_c_test)"
+gdb_test_sequence "info tracepoint $c_test_num" \
+ "2.2a: info tracepoint $c_test_num (gdb_c_test)" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\]\tnot installed on target"
+ }

-gdb_test "info tracepoint $asm_test_num" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
- "2.2b: info tracepoint $asm_test_num (gdb_asm_test)"
+gdb_test_sequence "info tracepoint $asm_test_num" \
+ "2.2b: info tracepoint $asm_test_num (gdb_asm_test)" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]2 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n\]\tnot installed on target."
+ }

# 2.3 info tracepoint (invalid tracepoint number)
gdb_test "info tracepoint [expr $c_test_num + $asm_test_num]" \
diff --git a/gdb/testsuite/gdb.trace/passcount.exp b/gdb/testsuite/gdb.trace/passcount.exp
index a179021..35231e4 100644
--- a/gdb/testsuite/gdb.trace/passcount.exp
+++ b/gdb/testsuite/gdb.trace/passcount.exp
@@ -58,46 +58,48 @@ if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {

# 4.1 passcount of specified tracepoint

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
- "4.1a: set three tracepoints, passcounts all zero"
+gdb_test_sequence "info tracepoints" \
+ "4.1a: set three tracepoints, passcounts all zero" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]2 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]3 tracepoint keep y.* in gdb_recursion_test at "
+ "\[\r\n\]\tnot installed on target"
+ }

gdb_test "passcount 2 $trcpt1" \
"Setting tracepoint $trcpt1.s passcount to 2" \
"4.1b: set 1st tracepoint's passcount to two"

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 2 .
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
- "4.1c: verify 1st tracepoint's passcount set to two"
-
+gdb_test_sequence "info tracepoints" \
+ "4.1c: verify 1st tracepoint's passcount set to two" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\]\tpass count 2 "
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]2 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]3 tracepoint keep y.* in gdb_recursion_test at "
+ "\[\r\n\]\tnot installed on target"
+ }
gdb_test "passcount 4 $trcpt2" \
"Setting tracepoint $trcpt2.s passcount to 4" \
"4.1d: set 2nd tracepoint's passcount to four"

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 2 .
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 4 .
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
- "4.1c: verify 2nd tracepoint's passcount set to four"
+gdb_test_sequence "info tracepoints" \
+ "4.1c: verify 2nd tracepoint's passcount set to four" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\]\tpass count 2 "
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]2 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n\]\tpass count 4 "
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]3 tracepoint keep y.* in gdb_recursion_test at "
+ "\[\r\n\]\tnot installed on target"
+}

# 4.2 passcount of last (default) tracepoint

@@ -105,15 +107,16 @@ gdb_test "passcount 6" \
"Setting tracepoint $trcpt3.s passcount to 6" \
"4.2b: set last (default) tp's passcount to six"

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 2 .*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 4 .*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 6 .*" \
- "4.2b: verify last (default) tp's passcount set to six"
+gdb_test_sequence "info tracepoints" \
+ "4.2b: verify last (default) tp's passcount set to six" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\]\tpass count 2 "
+ "\[\r\n\]2 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n\]\tpass count 4 "
+ "\[\r\n\]3 tracepoint keep y.* in gdb_recursion_test at "
+ "\[\r\n\]\tpass count 6 "
+ }

# 4.3 run until stopped explicitly by user
# [deferred to dynamic test section]
@@ -124,29 +127,31 @@ gdb_test "passcount 7" \
"Setting tracepoint $trcpt3.s passcount to 7" \
"4.4a: reset last (default) tp's passcount to seven"

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 2 .*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 4 .*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 7 .*" \
- "4.4a: verify reset last (default) tp's passcount to seven"
+gdb_test_sequence "info tracepoints" \
+ "4.4a: verify reset last (default) tp's passcount to seven" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\]\tpass count 2 "
+ "\[\r\n\]2 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n\]\tpass count 4 "
+ "\[\r\n\]3 tracepoint keep y.* in gdb_recursion_test at "
+ "\[\r\n\]\tpass count 7 "
+ }

gdb_test "passcount 5 $trcpt2" \
"Setting tracepoint $trcpt2.s passcount to 5" \
"4.4b: reset second tracepoint's passcount to five"

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 2 .*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 5 .*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 7 .*" \
- "4.4c: verify reset second tracepoint's passcount to five"
+gdb_test_sequence "info tracepoints" \
+ "4.4c: verify reset second tracepoint's passcount to five" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\]\tpass count 2 "
+ "\[\r\n\]2 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n\]\tpass count 5 "
+ "\[\r\n\]3 tracepoint keep y.* in gdb_recursion_test at "
+ "\[\r\n\]\tpass count 7 "
+ }

# 4.20 <FIXME test number> passcount for "all"

@@ -154,29 +159,31 @@ gdb_test "passcount 3 all" \
".*$trcpt1.s pass.* 3.*$trcpt2.s pass.* 3.*$trcpt3.s pass.* 3" \
"4.20a: set all three passcounts to three"

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 3 .*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 3 .*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 3 .*" \
- "4.20a: set all three passcounts to three"
+gdb_test_sequence "info tracepoints" \
+ "4.20a: set all three passcounts to three" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y .* in gdb_c_test at "
+ "\[\r\n\]\tpass count 3 "
+ "\[\r\n\]2 tracepoint keep y .* in gdb_asm_test at "
+ "\[\r\n\]\tpass count 3 "
+ "\[\r\n\]3 tracepoint keep y .* in gdb_recursion_test at "
+ "\[\r\n\]\tpass count 3 "
+ }

gdb_test "passcount 4 all" \
".*$trcpt1.s pass.* 4.*$trcpt2.s pass.* 4.*$trcpt3.s pass.* 4" \
"4.20a: reset all three passcounts to four"

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 4 .*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 4 .*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 4 .*" \
- "4.20b: reset all three passcounts to four"
+gdb_test_sequence "info tracepoints" \
+ "4.20b: reset all three passcounts to four" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\]\tpass count 4 "
+ "\[\r\n\]2 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n\]\tpass count 4 "
+ "\[\r\n\]3 tracepoint keep y.* in gdb_recursion_test at "
+ "\[\r\n\]\tpass count 4 "
+ }

# 4.5 Verify trace stops on first "satisfied" passcount
# [deferred to dynamic test section]
@@ -187,17 +194,17 @@ gdb_test "passcount 0 $trcpt1" \
"Setting tracepoint $trcpt1.s passcount to 0" \
"4.6: set passcount to zero"

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 4 .
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 4 .
-\[\t \]+not installed on target." \
- "4.6: set passcount to zero"
+gdb_test_sequence "info tracepoints" "4.6: set passcount to zero" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y .* in gdb_c_test at "
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]2 tracepoint keep y .* in gdb_asm_test at "
+ "\[\r\n\]\tpass count 4 "
+ "\[\r\n\]\tnot installed on target"
+ "\[\r\n\]3 tracepoint keep y .* in gdb_recursion_test at "
+ "\[\r\n\]\tpass count 4 "
+ "\[\r\n\]\tnot installed on target"
+}

# 4.7 (test a very large passcount)

@@ -205,15 +212,16 @@ gdb_test "passcount 32767 $trcpt1" \
"Setting tracepoint $trcpt1.s passcount to 32767" \
"4.7: set passcount to large number (32767)"

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 32767 .*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 4 .*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 4 .*" \
- "4.7: set passcount to large number (32767)"
+gdb_test_sequence "info tracepoints" \
+ "4.7: set passcount to large number (32767)" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\]\tpass count 32767 "
+ "\[\r\n\]2 tracepoint keep y.* in gdb_asm_test at "
+ "\[\r\n\]\tpass count 4 "
+ "\[\r\n\]3 tracepoint keep y.* in gdb_recursion_test at "
+ "\[\r\n\]\tpass count 4 "
+ }

# 4.8 set passcount for invalid tracepoint

diff --git a/gdb/testsuite/gdb.trace/while-stepping.exp b/gdb/testsuite/gdb.trace/while-stepping.exp
index 3e60587..3202ea5 100644
--- a/gdb/testsuite/gdb.trace/while-stepping.exp
+++ b/gdb/testsuite/gdb.trace/while-stepping.exp
@@ -47,11 +47,13 @@ if { $trcpt1 <= 0 } then {

# 5.12 basic while-stepping command (collect regs)

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
- "5.12: set a tracepoint, stepcount is zero"
+gdb_test_sequence "info tracepoints" \
+ "5.12: set a tracepoint, stepcount is zero" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\]\tnot installed on target"
+ }
+

set stepcount 12

@@ -61,11 +63,12 @@ gdb_trace_setactions "5.12: set stepcount to $stepcount" \
"collect \$regs" "^$" \
"end" ""

-gdb_test "info tracepoints" \
- "Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+while-stepping 12.*" \
- "5.12: info trace shows \"while-stepping\""
+gdb_test_sequence "info tracepoints" \
+ "5.12: info trace shows \"while-stepping\"" {
+ "\[\r\n\]Num Type\[ \]+Disp Enb Address\[ \]+What"
+ "\[\r\n\]1 tracepoint keep y.* in gdb_c_test at "
+ "\[\r\n\] while-stepping 12"
+ }

# 5.13 step out of context while collecting local variable
# [deferred to dynamic test section]
--
1.7.7.6