This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Make dg-extract-results.sh explicitly treat .{sum,log} files as text
- From: Mike Stump <mikestump at comcast dot net>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 16 Dec 2014 02:03:07 -0800
- Subject: Re: [PATCH] Make dg-extract-results.sh explicitly treat .{sum,log} files as text
- Authentication-results: sourceware.org; auth=none
- References: <1418683023-26087-1-git-send-email-sergiodj at redhat dot com>
On Dec 15, 2014, at 2:37 PM, Sergio Durigan Junior <sergiodj@redhat.com> wrote:
> This weekend I was running GDB's testsuite with many options enabled,
> and I noticed that, for some specific configurations (specifically
> when testing gdbserver), I was getting the following error:
> Binary file outputs/gdb.base/gdb-sigterm/gdb.log matches
>
> Right, the problem is that grep is assuming those 6 files are binary,
> not text. This happens because of this code, in grep:
> If one looks at those 6 files, one will find that they contain the NUL
> byte there. They are all printed by the same message, by gdbserver's
> code:
>
> input_interrupt, count = 0 c = 0 ('^@')
>
> (The ^@ above is the NUL byte.)
So, either, the tool should not generate 0 in the output, which, is rather anti-social, or one should strip the funny characters in a more portable fashion.
tr and cat -v come to mind; both should be pretty portable.
> OK to apply?
Try cat | cat -v in there instead.