From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73967 invoked by alias); 2 Aug 2017 20:22:00 -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 73896 invoked by uid 89); 2 Aug 2017 20:21:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=colors X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 02 Aug 2017 20:21:57 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id v72KLogG003683 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 2 Aug 2017 16:21:55 -0400 Received: by simark.ca (Postfix, from userid 112) id A1C921EA01; Wed, 2 Aug 2017 16:21:50 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 256F21E5E2; Wed, 2 Aug 2017 16:21:50 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 02 Aug 2017 20:22:00 -0000 From: Simon Marchi To: Andreas Arnez Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] GDB testsuite: Suppress GCC's colored output In-Reply-To: References: Message-ID: <7b9c299818a8b32b0198e5d016d47abd@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 2 Aug 2017 20:21:50 +0000 X-IsSubscribed: yes X-SW-Source: 2017-08/txt/msg00054.txt.bz2 On 2017-08-02 19:35, Andreas Arnez wrote: > Newer GCC versions yield colored diagnostic messages by default, which > may > be useful when executing GDB interactively from a terminal. But when > run > from a GDB test case, the compiler output is written into gdb.log, > where > such escape sequences are usually more inhibiting than helpful to the > evaluation of test results. So this patch suppresses that. That's because you are not using the right viewer :). Try "less -R gdb.log", you should see the rainbow. > > gdb/testsuite/ChangeLog: > > * lib/gdb.exp (gdb_compile): Suppress GCC's coloring of messages. > --- > gdb/testsuite/lib/gdb.exp | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index 3d3eaab..9a5c27f 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -3552,6 +3552,9 @@ proc gdb_compile {source dest type options} { > } > } > > + # Stop the compiler from producing colored output. > + setenv GCC_COLORS "" > + > set result [target_compile $source $dest $type $options] > > # Prune uninteresting compiler (and linker) output. I was wondering why GCC showed colors even though it's not invoked "interactively". Dejagnu uses expect's spawn to spawn processes, including the compiler. spawn allocates a tty for the subprocess, which is what GCC checks to determine whether or not to enable colors. You patch LGTM, but please leave the patch for review for a few days, then push it if nobody says anything. Thanks! Simon