This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix testsuite race with multi-line commands


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]