From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24003 invoked by alias); 20 Jul 2013 00:38:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 23977 invoked by uid 89); 20 Jul 2013 00:38:33 -0000 X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_50,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE autolearn=no version=3.3.1 Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 20 Jul 2013 00:38:32 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1V0LBo-0004ta-9C from Yao_Qi@mentor.com ; Fri, 19 Jul 2013 17:38:24 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 19 Jul 2013 17:38:24 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.2.247.3; Fri, 19 Jul 2013 17:38:23 -0700 Message-ID: <51E9DBD4.4070605@codesourcery.com> Date: Sat, 20 Jul 2013 00:38:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Eli Zaretskii CC: Subject: Re: [PATCH] native mingw32 gdb, eol format References: <1373936767-14858-1-git-send-email-yao@codesourcery.com> <83ppuj2p7r.fsf@gnu.org> In-Reply-To: <83ppuj2p7r.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-SW-Source: 2013-07/txt/msg00473.txt.bz2 On 07/16/2013 10:50 AM, Eli Zaretskii wrote: > No, it's not. A MinGW GDB is a native Windows program, and should > behave like one. Windows programs generally don't expect text coming > through pipes to have Unix EOL format. Also, it is terribly confusing > to have GDB behave differently with its standard handles redirected to > a pipe as opposed to disk files or the console device. > OK, that makes sense. I also find something similar was discussed in 2009, [RFC] Improve testsuite for poor expect behavior http://sourceware.org/ml/gdb-patches/2009-06/msg00346.html but patches didn't go in then. I withdraw this patch. > This is a problem with the test suite, so please fix it in the test > suite. If you_must_ make the change in GDB, please introduce some > specialized option to do that. But changing the default behavior like > that is IMO a no-starter. Looks fixing the testsuite to allow '\r\r\n' is a promising approach, however it is not a small piece of work. The patch below is a proof-of-concept implementation, and we need to apply the change (\r -> ${cr}) to the testsuite. Please let me know is it what you want, and then I can evaluate how much efforts are needed here. -- Yao (齐尧) gdb/testsuite: * gdb.trace/deltrace.exp: Match $cr at the end of each line. * lib/gdb.exp: Set cr. --- gdb/testsuite/gdb.trace/deltrace.exp | 20 ++++++++++---------- gdb/testsuite/lib/gdb.exp | 8 ++++++++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/gdb/testsuite/gdb.trace/deltrace.exp b/gdb/testsuite/gdb.trace/deltrace.exp index 1053629..3f2a8b7 100644 --- a/gdb/testsuite/gdb.trace/deltrace.exp +++ b/gdb/testsuite/gdb.trace/deltrace.exp @@ -82,12 +82,12 @@ if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then { 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." \ +\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+${cr} +\[\t \]+not installed on target${cr} +\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+${cr} +\[\t \]+not installed on target${cr} +\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+${cr} +\[\t \]+not installed on target${cr}" \ "3.2a: set three tracepoints" #gdb_test_no_output "delete tracepoint $trcpt1" "" @@ -105,10 +105,10 @@ 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." \ +\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+${cr} +\[\t \]+not installed on target${cr} +\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+${cr} +\[\t \]+not installed on target${cr}" \ "3.2c: verify delete first tracepoint" #gdb_test_no_output "delete tracepoint $trcpt2" "" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index cb92a94..5d2ad15 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -102,6 +102,14 @@ set octal "\[0-7\]+" set inferior_exited_re "(\\\[Inferior \[0-9\]+ \\(.*\\) exited)" +# GDB configured for mingw or cygwin host can be run in a Cygwin PTY, +# which expands '\n' to '\r\n', so the EOL ('\r\n') becomes '\r\r\n'. +if { [ishost *-*-mingw*] || [ishost *cygwin*] } { + set cr "\r+" +} else { + set cr "\r" +} + ### Only procedures should come after this point. # -- 1.7.7.6