From: Simon Marchi <simon.marchi@polymtl.ca>
To: Andreas Arnez <arnez@linux.vnet.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] GDB testsuite: Suppress GCC's colored output
Date: Wed, 02 Aug 2017 20:22:00 -0000 [thread overview]
Message-ID: <7b9c299818a8b32b0198e5d016d47abd@polymtl.ca> (raw)
In-Reply-To: <m3vam527qh.fsf@oc1027705133.ibm.com>
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
next prev parent reply other threads:[~2017-08-02 20:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-02 17:35 Andreas Arnez
2017-08-02 20:22 ` Simon Marchi [this message]
2017-08-03 11:13 ` Andreas Arnez
[not found] ` <86h8xn3833.fsf@gmail.com>
2017-08-04 12:19 ` Simon Marchi
2017-08-04 13:00 ` Yao Qi
2017-08-08 18:29 ` Andreas Arnez
2017-08-09 10:01 ` Simon Marchi
2017-08-09 10:29 ` Yao Qi
2017-08-14 18:32 ` Andreas Arnez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7b9c299818a8b32b0198e5d016d47abd@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=arnez@linux.vnet.ibm.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox