* [PATCH 3/4] Transform \r\n in MI variables
2013-09-17 13:07 ` [PATCH 0/4] Match \r\r\n in testsuite Yao Qi
@ 2013-09-17 13:07 ` Yao Qi
2013-09-17 13:07 ` [PATCH 2/4] Transform "\r\n" in pattern to "\r+\n" Yao Qi
` (3 subsequent siblings)
4 siblings, 0 replies; 19+ messages in thread
From: Yao Qi @ 2013-09-17 13:07 UTC (permalink / raw)
To: gdb-patches
The previous patch can't transform \r\n in variables, so this patch
update these variables which have \r\n in MI.
gdb/testsuite:
2013-09-17 Yao Qi <yao@codesourcery.com>
* lib/mi-support.exp (mi_gdb_prompt): Replace "\r\n" with
"\r+\n".
(thread_selected_re): Likewise.
(gdbindex_warning_re): Likewise.
(library_loaded_re): Likewise.
(breakpoint_re): Likewise.
---
gdb/testsuite/lib/mi-support.exp | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index a9b22c2..86f91ac 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -21,7 +21,7 @@
# Set it if it is not already set.
global mi_gdb_prompt
if ![info exists mi_gdb_prompt] then {
- set mi_gdb_prompt "\[(\]gdb\[)\] \r\n"
+ set mi_gdb_prompt "\[(\]gdb\[)\] \r+\n"
}
global mi_inferior_spawn_id
@@ -29,10 +29,10 @@ global mi_inferior_tty_name
set MIFLAGS "-i=mi"
-set thread_selected_re "=thread-selected,id=\"\[0-9\]+\"\r\n"
-set gdbindex_warning_re "&\"warning: Skipping \[^\r\n\]+ \.gdb_index section in \[^\r\n\]+\"\r\n(?:&\"\\\\n\"\r\n)?"
-set library_loaded_re "=library-loaded\[^\n\]+\"\r\n(?:$gdbindex_warning_re)?"
-set breakpoint_re "=(?:breakpoint-created|breakpoint-deleted)\[^\n\]+\"\r\n"
+set thread_selected_re "=thread-selected,id=\"\[0-9\]+\"\r+\n"
+set gdbindex_warning_re "&\"warning: Skipping \[^\r\n\]+ \.gdb_index section in \[^\r\n\]+\"\r+\n(?:&\"\\\\n\"\r+\n)?"
+set library_loaded_re "=library-loaded\[^\n\]+\"\r+\n(?:$gdbindex_warning_re)?"
+set breakpoint_re "=(?:breakpoint-created|breakpoint-deleted)\[^\n\]+\"\r+\n"
#
# mi_gdb_exit -- exit the GDB, killing the target program if necessary
--
1.7.7.6
^ permalink raw reply [flat|nested] 19+ messages in thread* [PATCH 2/4] Transform "\r\n" in pattern to "\r+\n"
2013-09-17 13:07 ` [PATCH 0/4] Match \r\r\n in testsuite Yao Qi
2013-09-17 13:07 ` [PATCH 3/4] Transform \r\n in MI variables Yao Qi
@ 2013-09-17 13:07 ` Yao Qi
2013-09-17 23:11 ` Pierre Muller
2013-09-17 13:07 ` [PATCH 4/4] Replace "." with "\r+" Yao Qi
` (2 subsequent siblings)
4 siblings, 1 reply; 19+ messages in thread
From: Yao Qi @ 2013-09-17 13:07 UTC (permalink / raw)
To: gdb-patches
This patch transforms the "\r\n" in pattern to "\r+\n". Note that
"\r\n" in variable can't be transformed by this patch.
gdb/testsuite:
2013-09-17 Yao Qi <yao@codesourcery.com>
* lib/gdb.exp (gdb_transform_eol): New proc.
(gdb_expect): Invoke gdb_transform_eol.
* lib/mi-support.exp (mi_gdb_test): Likewise.
---
gdb/testsuite/lib/gdb.exp | 22 ++++++++++++++++++++++
gdb/testsuite/lib/mi-support.exp | 2 ++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 9b319e2..30d8755 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2903,6 +2903,26 @@ proc send_gdb { string } {
return [remote_send host "$string"]
}
+# Transform the end-of-line in PATTERN. In test cases, we assume
+# that end-of-line is "\r\n", but that is not true on some targets.
+# this proc transforms "\r\n" to the desired form.
+
+proc gdb_transform_eol { pattern } {
+
+ if [ishost "i?86-*-mingw*"] {
+ # On Windows, when a file is opened in text mode, a "\n" is
+ # always expanded to "\r\n", so gdb on Windows is outputting
+ # "\r\n", and when that goes through the PTY, the '\n' is
+ # being expanded to "\r\n", hence "\r\r\n".
+ # Expand "\r\n" in $expcode to "\r+\n" in order to match
+ # "\r\r\n".
+ regsub -all {\\r\\n} $pattern {\\r+\\n} pattern
+ regsub -all {\r\n} $pattern {\r+\n} pattern
+ }
+
+ return $pattern
+}
+
#
#
@@ -2914,6 +2934,8 @@ proc gdb_expect { args } {
set expcode $args
}
+ set expcode [gdb_transform_eol $expcode]
+
upvar timeout timeout
if [target_info exists gdb,timeout] {
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 86a0fd6..a9b22c2 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -597,6 +597,8 @@ proc mi_gdb_test { args } {
set question_string "^FOOBAR$"
}
+ set pattern [gdb_transform_eol $pattern]
+
if $verbose>2 then {
send_user "Sending \"$command\" to gdb\n"
send_user "Looking to match \"$pattern\"\n"
--
1.7.7.6
^ permalink raw reply [flat|nested] 19+ messages in thread* RE: [PATCH 2/4] Transform "\r\n" in pattern to "\r+\n"
2013-09-17 13:07 ` [PATCH 2/4] Transform "\r\n" in pattern to "\r+\n" Yao Qi
@ 2013-09-17 23:11 ` Pierre Muller
0 siblings, 0 replies; 19+ messages in thread
From: Pierre Muller @ 2013-09-17 23:11 UTC (permalink / raw)
To: 'Yao Qi', gdb-patches
Hi Yao,
I tried this some time ago, see:
https://sourceware.org/ml/gdb-patches/2010-06/msg00039.html
but I ended up with something much more complicated ...
The primary reason is that your code below will also change
[\r\n] into [\r+\n] which is not really what it should do...
It could also interfere with messages (not patterns)
in expcode that contain \r\n sequences...
Finally, I think that there is also a completely orthogonal
solution to the problem you mention, which is to force
GDB to use binary mode for stdout and stderr instead of text mode.
Your patch to fix the ordering of stderr versus stdout output seem to
work, so the only remaining specific mingw host is that GDB uses text mode
for its stdout and stderr.
This is an adaptation/simplification of a previous idea I proposed, to
add:
maint set testsuite-mode on/off
command, which was both setting stdout and stderr to binary mode and
disabled any buffering for this handles.
https://sourceware.org/ml/gdb-patches/2013-07/msg00701.html
I will try to submit this patch shortly.
Pierre Muller
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Yao Qi
> Envoyé : mardi 17 septembre 2013 15:06
> À : gdb-patches@sourceware.org
> Objet : [PATCH 2/4] Transform "\r\n" in pattern to "\r+\n"
>
> This patch transforms the "\r\n" in pattern to "\r+\n". Note that
> "\r\n" in variable can't be transformed by this patch.
>
> gdb/testsuite:
>
> 2013-09-17 Yao Qi <yao@codesourcery.com>
>
> * lib/gdb.exp (gdb_transform_eol): New proc.
> (gdb_expect): Invoke gdb_transform_eol.
> * lib/mi-support.exp (mi_gdb_test): Likewise.
> ---
> gdb/testsuite/lib/gdb.exp | 22 ++++++++++++++++++++++
> gdb/testsuite/lib/mi-support.exp | 2 ++
> 2 files changed, 24 insertions(+), 0 deletions(-)
>
> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
> index 9b319e2..30d8755 100644
> --- a/gdb/testsuite/lib/gdb.exp
> +++ b/gdb/testsuite/lib/gdb.exp
> @@ -2903,6 +2903,26 @@ proc send_gdb { string } {
> return [remote_send host "$string"]
> }
>
> +# Transform the end-of-line in PATTERN. In test cases, we assume
> +# that end-of-line is "\r\n", but that is not true on some targets.
> +# this proc transforms "\r\n" to the desired form.
> +
> +proc gdb_transform_eol { pattern } {
> +
> + if [ishost "i?86-*-mingw*"] {
> + # On Windows, when a file is opened in text mode, a "\n" is
> + # always expanded to "\r\n", so gdb on Windows is outputting
> + # "\r\n", and when that goes through the PTY, the '\n' is
> + # being expanded to "\r\n", hence "\r\r\n".
> + # Expand "\r\n" in $expcode to "\r+\n" in order to match
> + # "\r\r\n".
> + regsub -all {\\r\\n} $pattern {\\r+\\n} pattern
> + regsub -all {\r\n} $pattern {\r+\n} pattern
> + }
> +
> + return $pattern
> +}
> +
> #
> #
>
> @@ -2914,6 +2934,8 @@ proc gdb_expect { args } {
> set expcode $args
> }
>
> + set expcode [gdb_transform_eol $expcode]
> +
> upvar timeout timeout
>
> if [target_info exists gdb,timeout] {
> diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-
> support.exp
> index 86a0fd6..a9b22c2 100644
> --- a/gdb/testsuite/lib/mi-support.exp
> +++ b/gdb/testsuite/lib/mi-support.exp
> @@ -597,6 +597,8 @@ proc mi_gdb_test { args } {
> set question_string "^FOOBAR$"
> }
>
> + set pattern [gdb_transform_eol $pattern]
> +
> if $verbose>2 then {
> send_user "Sending \"$command\" to gdb\n"
> send_user "Looking to match \"$pattern\"\n"
> --
> 1.7.7.6
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 4/4] Replace "." with "\r+".
2013-09-17 13:07 ` [PATCH 0/4] Match \r\r\n in testsuite Yao Qi
2013-09-17 13:07 ` [PATCH 3/4] Transform \r\n in MI variables Yao Qi
2013-09-17 13:07 ` [PATCH 2/4] Transform "\r\n" in pattern to "\r+\n" Yao Qi
@ 2013-09-17 13:07 ` Yao Qi
2013-09-17 13:07 ` [PATCH 1/4] Use gdb_test_sequence to test "info tracepoints" Yao Qi
2013-09-17 13:35 ` [PATCH 0/4] Match \r\r\n in testsuite Joel Brobecker
4 siblings, 0 replies; 19+ messages in thread
From: Yao Qi @ 2013-09-17 13:07 UTC (permalink / raw)
To: gdb-patches
These "gdb_test" can't be replaced by "gdb_test_sequence" because
variables are used in patterns, and variables can't be expanded.
We replace "." with "\r+" one by one.
gdb/testsuite:
2013-09-17 Yao Qi <yao@codesourcery.com>
* gdb.trace/tracecmd.exp (gdb_delete_tracepoints): Replace "."
with "\r+" in patterns.
* gdb.trace/while-stepping.exp: Likewise.
---
gdb/testsuite/gdb.trace/tracecmd.exp | 12 ++++++------
gdb/testsuite/gdb.trace/while-stepping.exp | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gdb/testsuite/gdb.trace/tracecmd.exp b/gdb/testsuite/gdb.trace/tracecmd.exp
index 81dc1ed..a239d75 100644
--- a/gdb/testsuite/gdb.trace/tracecmd.exp
+++ b/gdb/testsuite/gdb.trace/tracecmd.exp
@@ -62,7 +62,7 @@ gdb_delete_tracepoints
gdb_test "trace $srcfile:$testline2" \
"Tracepoint $decimal at $hex: file.*$srcfile, line $testline2." \
"1.1a: set tracepoint at sourceline"
-gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline2.
+gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline2\r+
\[\t \]+not installed on target." \
"1.1b: trace sourcefile:line"
@@ -86,7 +86,7 @@ gdb_delete_tracepoints
gdb_test "trace gdb_recursion_test" \
"Tracepoint $decimal at $hex: file.*$srcfile, line $testline1." \
"1.4a: trace function by name"
-gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline1.
+gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline1\r+
\[\t \]+not installed on target." \
"1.4b: trace function by name"
@@ -124,7 +124,7 @@ gdb_delete_tracepoints
gdb_test "trace \*gdb_recursion_test" \
"Tracepoint $decimal at .*$c_test_addr.*" \
"1.7a: trace at function label (before prologue)"
-gdb_test "info trace" "$c_test_addr.*in gdb_recursion_test.*:$baseline.
+gdb_test "info trace" "$c_test_addr.*in gdb_recursion_test.*:$baseline\r+
\[\t \]+not installed on target." \
"1.7b: verify trace at specific address"
@@ -142,9 +142,9 @@ gdb_delete_tracepoints
gdb_test "trace gdb_recursion_test if q1 > 0" \
"Tracepoint $decimal at $hex: file.*$srcfile, line $testline1." \
"1.11a: conditional tracepoint"
-gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline1.
-\[\t \]+trace only if q1 > 0.
-\[\t \]+not installed on target." \
+gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline1\r+
+\[\t \]+trace only if q1 > 0\r+
+\[\t \]+not installed on target\r+" \
"1.11b: verify conditional tracepoint"
# 1.12 set tracepoint in prologue
diff --git a/gdb/testsuite/gdb.trace/while-stepping.exp b/gdb/testsuite/gdb.trace/while-stepping.exp
index 3202ea5..77dba1d 100644
--- a/gdb/testsuite/gdb.trace/while-stepping.exp
+++ b/gdb/testsuite/gdb.trace/while-stepping.exp
@@ -97,7 +97,7 @@ gdb_trace_setactions "5.16: step without collecting anything" \
gdb_test "info tracepoints" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
+\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+\r+
.*while-stepping $stepcount.*
.*end.*" \
"5.16: confirm actions, step without collecting anything"
--
1.7.7.6
^ permalink raw reply [flat|nested] 19+ messages in thread* [PATCH 1/4] Use gdb_test_sequence to test "info tracepoints"
2013-09-17 13:07 ` [PATCH 0/4] Match \r\r\n in testsuite Yao Qi
` (2 preceding siblings ...)
2013-09-17 13:07 ` [PATCH 4/4] Replace "." with "\r+" Yao Qi
@ 2013-09-17 13:07 ` Yao Qi
2013-09-17 13:35 ` [PATCH 0/4] Match \r\r\n in testsuite Joel Brobecker
4 siblings, 0 replies; 19+ messages in thread
From: Yao Qi @ 2013-09-17 13:07 UTC (permalink / raw)
To: gdb-patches
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
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH 0/4] Match \r\r\n in testsuite
2013-09-17 13:07 ` [PATCH 0/4] Match \r\r\n in testsuite Yao Qi
` (3 preceding siblings ...)
2013-09-17 13:07 ` [PATCH 1/4] Use gdb_test_sequence to test "info tracepoints" Yao Qi
@ 2013-09-17 13:35 ` Joel Brobecker
2013-09-17 13:59 ` Yao Qi
4 siblings, 1 reply; 19+ messages in thread
From: Joel Brobecker @ 2013-09-17 13:35 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
> Then, I restarted from the beginning again, and see if we can fix the
> problem by modifying testsuite. The requirement expressed in the
> previous patch review is that we should localize the changes to
> testsuite to match \r\r\n.
>
> This patch series is to change testsuite to match both \r\n and
> \r\r\n by modifying pattern to \r+\n in a localized manner. Patch 1/4
> is to replace gdb_test with gdb_test_sequence to match the output of
> "info tracepoints", so that the assumption of last character of each
> line is removed, so these patterns can be matched on all targets.
> Patch 2/4 is to transform \r\n in patterns to \r+\n, but \r\n in
> variables can't be transformed. Patch 3/4 transforms \r\n in variables.
How about we introduce a new official variable, similar to $hex,
$decimal, etc, which would correctly match new-line output based
on the host? I propose $eol, which is already used, but only in
2 testcases, so easy to adjust (remove "set eol ..." in those two
testcases).
--
Joel
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH 0/4] Match \r\r\n in testsuite
2013-09-17 13:35 ` [PATCH 0/4] Match \r\r\n in testsuite Joel Brobecker
@ 2013-09-17 13:59 ` Yao Qi
2013-09-17 14:06 ` Joel Brobecker
0 siblings, 1 reply; 19+ messages in thread
From: Yao Qi @ 2013-09-17 13:59 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
On 09/17/2013 09:35 PM, Joel Brobecker wrote:
> How about we introduce a new official variable, similar to $hex,
> $decimal, etc, which would correctly match new-line output based
> on the host? I propose $eol, which is already used, but only in
> 2 testcases, so easy to adjust (remove "set eol ..." in those two
> testcases).
Yeah, that is fine to me. Considering patch 4/4, I'd like introduce two
variables, $cr and $eol, which can be defined like this,
if [istarget "*-*-mingw*"] {
set cr "\r\r"
} else {
set cr "\r"
}
set eol "${cr}\n"
In this way, patch 3/4 can be updated to something like,
- set mi_gdb_prompt "\[(\]gdb\[)\] \r\n"
+ set mi_gdb_prompt "\[(\]gdb\[)\] ${eol}"
and patch 4/4 can be updated to something like,
-gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline2.
+gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline2${cr}
patch 1/4/ and 2/4 can be unchanged. What do you think?
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH 0/4] Match \r\r\n in testsuite
2013-09-17 13:59 ` Yao Qi
@ 2013-09-17 14:06 ` Joel Brobecker
2013-09-18 8:21 ` Yao Qi
0 siblings, 1 reply; 19+ messages in thread
From: Joel Brobecker @ 2013-09-17 14:06 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
> Yeah, that is fine to me. Considering patch 4/4, I'd like introduce
> two variables, $cr and $eol, which can be defined like this,
>
> if [istarget "*-*-mingw*"] {
> set cr "\r\r"
> } else {
> set cr "\r"
> }
>
> set eol "${cr}\n"
>
> In this way, patch 3/4 can be updated to something like,
>
> - set mi_gdb_prompt "\[(\]gdb\[)\] \r\n"
> + set mi_gdb_prompt "\[(\]gdb\[)\] ${eol}"
>
> and patch 4/4 can be updated to something like,
>
> -gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline2.
> +gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline2${cr}
>
> patch 1/4/ and 2/4 can be unchanged. What do you think?
Can we look at fixing gdb_test to use that $eol instead? Is that
even necessary? I see the implementation is:
return [gdb_test_multiple $command $message {
-re "\[\r\n\]*($pattern)\[\r\n\]+$gdb_prompt $" {
if ![string match "" $message] then {
pass "$message"
}
}
It seems to me that it should match ${eol} already, no?
--
Joel
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH 0/4] Match \r\r\n in testsuite
2013-09-17 14:06 ` Joel Brobecker
@ 2013-09-18 8:21 ` Yao Qi
0 siblings, 0 replies; 19+ messages in thread
From: Yao Qi @ 2013-09-18 8:21 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
On 09/17/2013 10:06 PM, Joel Brobecker wrote:
> Can we look at fixing gdb_test to use that $eol instead? Is that
> even necessary? I see the implementation is:
>
> return [gdb_test_multiple $command $message {
> -re "\[\r\n\]*($pattern)\[\r\n\]+$gdb_prompt $" {
> if ![string match "" $message] then {
> pass "$message"
> }
> }
>
> It seems to me that it should match ${eol} already, no?
Yes, this pattern above should match ${eol}. However, how about the
code using gdb_test_mulitiple or gdb_expect to match? We have to fix
them too. We don't want to replace all instances of \r\n with ${eol},
which is painful.
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 19+ messages in thread