mc_translate.c: enable further uses of DLexpensive for scalar EQ/NE comparisons
[valgrind.git] / tests / filter_stderr_basic
blob4b6e4806be6e6cee9fb7dba514690097a76ce321
1 #! /bin/sh
3 # This filter should be applied to *every* stderr result. It removes
4 # Valgrind startup stuff and pid numbers.
6 # Nb: The GNU and BSD implementations of 'sed' are quite different, so
7 # anything remotely complicated (e.g. "\(a\|b\)" alternatives) can't be
8 # easily done. Use Perl instead for any such cases.
10 dir=`dirname $0`
12 # Remove ==pid== and --pid-- and **pid** strings
13 perl -p -e 's/(==|--|\*\*)[0-9]{1,7}\1 //' |
15 # Do NOT remove debug level output, i.e. lines beginning with --pid:
16 # Doing so would also remove asserts from the address space manager
17 # and we always to see those.
19 # Remove "Command: line". (If wrapping occurs, it won't remove the
20 # subsequent lines...)
21 sed "/^Command: .*$/d" |
23 # Remove "WARNING: assuming toc 0x.." strings
24 sed "/^WARNING: assuming toc 0x*/d" |
26 # Remove "Using Valgrind-$VERSION and LibVEX..." line.
27 # Tools have to filter their own line themselves.
28 sed "/^Using Valgrind-.* and LibVEX; rerun with -h for copyright info/ d" |
30 # Anonymise line numbers in vg_replace_malloc.c, remove dirname if present
31 perl -p -e "s/(m_replacemalloc\/)?vg_replace_malloc.c:\d+\)/vg_replace_malloc.c:...\)/" |
33 # Likewise for valgrind.h
34 perl -p -e "s/valgrind\.h:\d+\)/valgrind\.h:...\)/" |
36 # Hide suppressed error counts
37 sed "s/^\(ERROR SUMMARY[^(]*(suppressed: \)[0-9]*\( from \)[0-9]*)$/\10\20)/" |
39 # Reduce some libc incompatibility
40 $dir/filter_libc |
42 # Remove line info out of order warnings
43 sed "/warning: line info addresses out of order/d" |
45 # Older bash versions print abnormal termination messages on the stderr
46 # of the bash process. Newer bash versions redirect such messages properly.
47 # Suppress any redirected abnormal termination messages. You can find the
48 # complete list of messages in the bash source file siglist.c.
49 perl -n -e 'print if !/^(Segmentation fault|Alarm clock|Aborted|Bus error|Killed)( \(core dumped\))?$/' |
51 # Similar as above, but for ksh on Solaris/illumos.
52 perl -n -e 'print if !/^(Memory fault|Killed) $/' |
54 # Translate intercepted glibc functions back to their canonical name
55 perl -p -e "s/: memcpy\@\@?GLIBC_[.1-9]+ \(vg_replace_strmem.c:.*?\)/: memcpy \(vg_replace_strmem.c:...\)/" |
56 sed -e "s/: \(__GI_\|__\|\)\(memcmp\|memcpy\|strcpy\|strncpy\|strchr\|strrchr\)\(\|_sse4_1\|_sse42\|_sse2_unaligned\|_sse2\) (vg_replace_strmem.c:/: \2 (vg_replace_strmem.c:/" |
58 # Remove any ": dumping core" message as the user might have a
59 # limit set that prevents the core dump
60 sed "s/\(signal [0-9]* (SIG[A-Z]*)\): dumping core/\1/" |
62 # Remove the size in "The main thread stack size..." message.
63 sed "s/The main thread stack size used in this run was [0-9]*/The main thread stack size used in this run was .../" |
65 # Remove the size in "10482464 bytes below stack pointer" message.
66 sed "s/[0-9][0-9]* bytes below stack pointer/.... bytes below stack pointer/" |
68 # Suppress warnings from incompatible debug info
69 sed '/warning: the debug information found in "[^"]*" does not match/d' |
71 # Suppress warnings from Dwarf reader
72 sed '/warning: evaluate_Dwarf3_Expr: unhandled DW_OP_/d'