1#! /bin/sh 2 3dir=`dirname $0` 4 5sed -e "s:_pthread_start (in /usr/lib/libSystem.B.dylib):(within libpthread-?.?.so):" | 6 7$dir/../../tests/filter_stderr_basic | 8 9# Remove "drd, ..." line and the following copyright line. 10# Remove line numbers referring to drd's source code. 11# Remove libpthread's version number. 12# Remove line numbers from stack traces. 13sed \ 14-e "/^drd, a thread error detector$/d" \ 15-e "s/^Allocation context: stack of thread \([0-9]*\), offset -[0-9]*$/Allocation context: stack of thread \1, offset .../" \ 16-e "/^warning: evaluate_Dwarf3_Expr: unhandled DW_OP_.*/d" \ 17-e '/^warning: addVar:.*/d' \ 18-e 's/^Allocation context: Data section of .\//Allocation context: BSS section of /' \ 19-e '/^run: \/usr\/bin\/dsymutil.*/d' \ 20-e "s/, in frame #[0-9]* of thread /, in frame #? of thread /" \ 21-e "s/(tc20_verifywrap.c:261)/(tc20_verifywrap.c:262)/" \ 22-e "/^Copyright (C) 2006-201., and GNU GPL'd, by Bart Van Assche.$/d" \ 23-e "s/\([A-Za-z_]*\) (clone.S:[0-9]*)/\1 (in \/...libc...)/" \ 24-e "s/[A-Za-z_]* (pthread_create.c:[0-9]*)/(within libpthread-?.?.so)/" \ 25-e "s/[A-Za-z_]* (in [^ ]*libpthread-[0-9.]*\.so)/(within libpthread-?.?.so)/" \ 26-e "s:(within /lib[0-9]*/ld-[0-9.]*\.so):(within ld-?.?.so):" \ 27-e "s/was held during [0-9][0-9]*/was held during .../" \ 28-e "s: BSS section of [^<]*/: BSS section of :g" \ 29-e "s: vc \[[ ,:0-9]*\]: vc ...:g" \ 30-e "s/[@\$*]* (drd_pthread_intercepts.c:/ (drd_pthread_intercepts.c:/" \ 31-e "s/ (\([a-zA-Z_]*\.c\):[0-9]*)/ (\1:?)/" \ 32-e "s/ (\([a-zA-Z_]*\.h\):[0-9]*)/ (\1:?)/" \ 33-e "s/ (\([a-zA-Z_]*\.cpp\):[0-9]*)/ (\1:?)/" \ 34-e "s/\( name [^ ]*\)-[0-9]*\( oflag \)/\1\2/" \ 35-e '/^ by 0x[0-9a-fA-F]*: process_dl_debug (in \/lib[0-9]*\/ld-[0-9.]*\.so)$/d' \ 36-e "/^For counts of detected and suppressed errors, rerun with: -v$/d" | 37 38# Remove the message that more than hundred errors have been detected 39# (consists of two lines) and also the empty line above it. 40awk '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; }' | 41 42# Remove the message about experimental support for Darwin. 43awk '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; }' | 44 45# Anonymise addresses 46$dir/../../tests/filter_addresses 47 48