File: filter_stderr

package info (click to toggle)
valgrind 1%3A3.14.0-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 156,980 kB
  • sloc: ansic: 728,128; exp: 26,134; xml: 22,268; cpp: 7,638; asm: 7,312; makefile: 6,102; perl: 5,910; sh: 5,717
file content (62 lines) | stat: -rwxr-xr-x 3,378 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#! /bin/sh

dir=`dirname $0`

sed -e "s:_pthread_start (in /usr/lib/libSystem.B.dylib):(within libpthread-?.?.so):" |

$dir/../../tests/filter_stderr_basic |

# Perform Solaris-specific filtering.
if $dir/../../tests/os_test solaris; then
   perl -p $dir/filter_stderr_solaris
else
   cat
fi |

# Remove "drd, ..." line and the following copyright line.
# Remove line numbers referring to drd's source code.
# Remove libpthread's version number.
# Remove line numbers from stack traces.
sed \
-e "/^drd, a thread error detector$/d" \
-e "s/^Allocation context: stack of thread \([0-9]*\), offset -[0-9]*$/Allocation context: stack of thread \1, offset .../" \
-e "/^warning: evaluate_Dwarf3_Expr: unhandled DW_OP_.*/d" \
-e '/^warning: addVar:.*/d' \
-e 's/^Allocation context: Data section of .\//Allocation context: BSS section of /' \
-e '/^run: \/usr\/bin\/dsymutil.*/d' \
-e "s/, in frame #[0-9]* of thread /, in frame #? of thread /" \
-e "s/(\(functional\|thread\):[0-9]*)/(\1:...)/" \
-e "s/(tc20_verifywrap.c:261)/(tc20_verifywrap.c:262)/" \
-e "/^Copyright (C) 2006-201., and GNU GPL'd, by Bart Van Assche.$/d" \
-e "s/\([A-Za-z_]*\) (clone.S:[0-9]*)/\1 (in \/...libc...)/" \
-e "s/[A-Za-z_]* (pthread_create.c:[0-9]*)/(within libpthread-?.?.so)/" \
-e "s/[A-Za-z_]* (in [^ ]*libpthread-[0-9.]*\.so)/(within libpthread-?.?.so)/" \
-e "s:(within /lib[0-9]*/ld-[0-9.]*\.so):(within ld-?.?.so):" \
-e "s/was held during [0-9][0-9]*/was held during .../" \
-e "s: BSS section of [^<]*/: BSS section of :g" \
-e "s: vc \[[ ,:0-9]*\]: vc ...:g" \
-e "s/[@\$*]* (drd_pthread_intercepts.c:/ (drd_pthread_intercepts.c:/" \
-e "/\(pthread\|sem\)_[a-zA-Z0-9_]*_intercept/d" \
-e "s/ (\([a-zA-Z_]*\.c\):[0-9]*)/ (\1:?)/" \
-e "s/ (\([a-zA-Z_]*\.h\):[0-9]*)/ (\1:?)/" \
-e "s/ (\([a-zA-Z_]*\.cpp\):[0-9]*)/ (\1:?)/" \
-e "s/\( name [^ ]*\)-[0-9]*\( oflag \)/\1\2/" \
-e '/^   by 0x[0-9a-fA-F]*: process_dl_debug (in \/lib[0-9]*\/ld-[0-9.]*\.so)$/d' \
-e "/^For counts of detected and suppressed errors, rerun with: -v$/d" |

# Remove the message that more than hundred errors have been detected
# (consists of two lines) and also the empty line above it.
awk 'BEGIN{begin=1} {if ($0 == "More than 100 errors detected.  Subsequent errors") { getline; getline; } else { if (begin) begin = 0; else print last_line; }; last_line = $0; } END { if (! begin) print last_line; }' |

# Remove the message about experimental support for Darwin.
awk 'BEGIN{begin=1} { if ($0 == "WARNING: DRD support for Darwin is still considered as experimental.") { getline; getline; } else { if (begin) begin = 0; else print last_line; }; last_line = $0; } END { if (! begin) print last_line; }' |

# Make sure the first line of a stack trace starts with "at"
awk '{ s = !match(prev, "  by ") && !match(prev, "  at ") && match($0, "  by "); prev = $0; if (s) sub("  by ", "  at ", $0); print }' |

# Remove <frame>...<file>drd_pthread_intercepts.c</file>...</frame>
awk '/^    <frame>$/ { in_frame = 1; line = 0; drd_pthread_intercepts = 0; fn = 0; } /^      <file>drd_pthread_intercepts.c<\/file>$/ { drd_pthread_intercepts = 1; } /^      <fn>/ { fn = 1; } { if (in_frame) frame[line++] = $0; else print; } /^    <\/frame>/ { if (in_frame) { if (!drd_pthread_intercepts || fn) for (i = 0; i < line; i++) { print frame[i]; }; in_frame = 0; } }' |

# Anonymise addresses
$dir/../../tests/filter_addresses