On Dec 15, 2014, at 2:37 PM, Sergio Durigan Junior <[email protected]> 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.