This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Fix testsuite race with multi-line commands
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 14 Oct 2011 10:39:16 +0200
- Subject: Re: Fix testsuite race with multi-line commands
- References: <Pine.LNX.4.64.1110131303280.20236@digraph.polyomino.org.uk>
On Thu, 13 Oct 2011 15:05:32 +0200, Joseph S. Myers wrote:
> 2011-10-13 Joseph Myers <joseph@codesourcery.com>
>
> * lib/gdb.exp (gdb_test_multiple): Expect newline and secondary
> prompt for each extra line in command.
[...]
> --- lib/gdb.exp 29 Sep 2011 15:17:50 -0000 1.189
> +++ lib/gdb.exp 13 Oct 2011 12:56:03 -0000
> @@ -677,6 +677,7 @@ proc gdb_test_multiple { command message
> set result -1
> set string "${command}\n";
> if { $command != "" } {
> + set multi_line_re "\[\r\n\] *>"
> while { "$string" != "" } {
> set foo [string first "\n" "$string"];
> set len [string length "$string"];
> @@ -697,10 +698,11 @@ proc gdb_test_multiple { command message
> # command output is not lost for pattern matching
> # - guo
> gdb_expect 2 {
> - -notransfer -re "\[\r\n\]" { verbose "partial: match" 3 }
> + -notransfer -re "$multi_line_re" { verbose "partial: match" 3 }
I would prefer here -notransfer -re "$multi_line_re$" { verbose "partial: match" 3 }
(It may be considered unrelated.)
> timeout { verbose "partial: timeout" 3 }
> }
> set string [string range "$string" [expr $foo + 1] end];
> + set multi_line_re "$multi_line_re.*\[\r\n\] *>"
> } else {
> break;
> }
OK with that change.
Thanks,
Jan