mc-manual.xml fix new/delete expresions -> expression
[valgrind.git] / tests / filter_libc
blob160f1a4b4d9be15cc861b97bf0f4f9d948f4d770
1 #!/usr/bin/env perl
3 use strict;
4 use warnings;
6 while (<>)
8 s/ __getsockname / getsockname /;
9 s/ __sigaction / sigaction /;
10 s/ __GI___/ __/;
11 s/ __([a-z]*)_nocancel / $1 /;
13 # "lib[S|s]ystem*" occurs on Darwin, "libsocket" on older Solaris/illumos.
14 s/\(in \/.*(libc|libSystem|libsystem|libsocket|libsys).*\)$/(in \/...libc...)/;
15 s/\(within \/.*(libc|libSystem|libsystem|libsocket).*\)$/(within \/...libc...)/;
17 # Filter out dynamic loader
18 s/ \(in \/.*ld-.*so\)$//;
20 # Remove the filename -- on some platforms (eg. Linux) it will be in
21 # libc, on some (eg. Darwin) it will be in the main executable.
22 s/\(below main\) \(.+\)$/(below main)/;
23 s/start \(in \/usr\/lib\/system\/libdyld.dylib\)/(below main)/;
25 # libc on x86 FreeBSD
26 s#_start1 \(src/lib/csu/i386/crt1_c.c.*#(below main)#;
27 s#__libc_start1 \(in /...libc...\)#(below main)#;
29 # filter out the exact libc-start.c:### line number. (ppc64*)
30 s/\(libc-start.c:[0-9]*\)$/(in \/...libc...)/;
32 # Merge the different C++ operator variations.
33 s/(at.*)__builtin_new/$1...operator new.../;
34 s/(at.*)operator new\(unsigned(| int| long)\)/$1...operator new.../;
36 s/(at.*)__builtin_vec_new/$1...operator new.../;
37 s/(at.*)operator new\[\]\(unsigned(| int| long)\)/$1...operator new[].../;
39 s/(at.*)__builtin_delete/$1...operator delete.../;
40 s/(at.*)operator delete\(void\*(, unsigned(| int| long))?\)/$1...operator delete.../;
42 s/(at.*)__builtin_vec_delete/$1...operator delete[].../;
43 s/(at.*)operator delete\[\]\(void\*\)/$1...operator delete[].../;
45 # Some glibc versions complain about unexpected futex syscall errors.
46 # With or without newline (see sourceware PR20271).
47 next if /^The futex facility returned an unexpected error code.$/;
48 s/The futex facility returned an unexpected error code.//;
50 print;
53 exit 0;