This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 0/4] Match \r\r\n in testsuite
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 17 Sep 2013 07:06:03 -0700
- Subject: Re: [PATCH 0/4] Match \r\r\n in testsuite
- Authentication-results: sourceware.org; auth=none
- References: <87a9ldyu8k dot fsf at fleche dot redhat dot com> <1379423179-8515-1-git-send-email-yao at codesourcery dot com> <20130917133530 dot GH3132 at adacore dot com> <52386003 dot 2050501 at codesourcery dot com>
> 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