From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8445 invoked by alias); 23 Aug 2013 20:36:56 -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 8352 invoked by uid 89); 23 Aug 2013 20:36:56 -0000 X-Spam-SWARE-Status: No, score=-7.7 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 23 Aug 2013 20:36:55 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7NKaspb031447 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 23 Aug 2013 16:36:54 -0400 Received: from barimba.redhat.com (ovpn-113-142.phx2.redhat.com [10.3.113.142]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r7NKarxO017513; Fri, 23 Aug 2013 16:36:54 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 01/13] fix up log-file toggling Date: Fri, 23 Aug 2013 20:37:00 -0000 Message-Id: <1377290210-483-2-git-send-email-tromey@redhat.com> In-Reply-To: <1377290210-483-1-git-send-email-tromey@redhat.com> References: <1377290210-483-1-git-send-email-tromey@redhat.com> X-SW-Source: 2013-08/txt/msg00705.txt.bz2 Currently a proc in gdb.exp toggles the expect (and thus dejagnu) logging. This is not a super idea, but it is there to avoid putting some preprocessor output into the log. In the right circumstances, this can result in the log file being mysteriously truncated. I think this happens because it doesn't necessarily write to the correct log file again. The fix is to use "log_file -info" to save the previous log file. * lib/gdb.exp (get_compiler_info): Use log_file -info and restore from that. --- gdb/testsuite/lib/gdb.exp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index f1f56a6..25a91dd 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2406,6 +2406,7 @@ proc get_compiler_info {{arg ""}} { # Run $ifile through the right preprocessor. # Toggle gdb.log to keep the compiler output out of the log. + set saved_log [log_file -info] log_file if [is_remote host] { # We have to use -E and -o together, despite the comments @@ -2418,7 +2419,7 @@ proc get_compiler_info {{arg ""}} { } else { set cppout [ gdb_compile "${ifile}" "" preprocess [list "$arg" quiet] ] } - log_file -a "$outdir/$tool.log" + eval log_file $saved_log # Eval the output. set unknown 0 -- 1.8.1.4