From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4973 invoked by alias); 18 Oct 2013 20:49:41 -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 4916 invoked by uid 89); 18 Oct 2013 20:49:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 18 Oct 2013 20:49:39 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9IKncNC011477 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 18 Oct 2013 16:49:38 -0400 Received: from barimba.redhat.com (ovpn-113-54.phx2.redhat.com [10.3.113.54]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r9IKnbii002849; Fri, 18 Oct 2013 16:49:38 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 01/17] fix up log-file toggling Date: Fri, 18 Oct 2013 20:49:00 -0000 Message-Id: <1382129374-18344-2-git-send-email-tromey@redhat.com> In-Reply-To: <1382129374-18344-1-git-send-email-tromey@redhat.com> References: <1382129374-18344-1-git-send-email-tromey@redhat.com> X-SW-Source: 2013-10/txt/msg00590.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 44786ec..fbb9f71 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