1#! /usr/bin/perl -w
2
3use strict;
4
5while (<>)
6{
7    s/ __getsockname / getsockname /;
8    s/ __sigaction / sigaction /;
9    s/ __GI___/ __/;
10    s/ __([a-z]*)_nocancel / $1 /;
11
12    # "lib[S|s]ystem*" occurs on Darwin, "libsocket" on older Solaris/illumos.
13    s/\(in \/.*(libc|libSystem|libsystem|libsocket).*\)$/(in \/...libc...)/;
14    s/\(within \/.*(libc|libSystem|libsystem|libsocket).*\)$/(within \/...libc...)/;
15
16    # Filter out dynamic loader
17    s/ \(in \/.*ld-.*so\)$//;
18
19    # Remove the filename -- on some platforms (eg. Linux) it will be in
20    # libc, on some (eg. Darwin) it will be in the main executable.
21    s/\(below main\) \(.+\)$/(below main)/;
22
23    # filter out the exact libc-start.c:### line number. (ppc64*)
24    s/\(libc-start.c:[0-9]*\)$/(in \/...libc...)/;
25
26    # Merge the different C++ operator variations.
27    s/(at.*)__builtin_new/$1...operator new.../;
28    s/(at.*)operator new\(unsigned(| int| long)\)/$1...operator new.../;
29
30    s/(at.*)__builtin_vec_new/$1...operator new.../;
31    s/(at.*)operator new\[\]\(unsigned(| int| long)\)/$1...operator new[].../;
32
33    s/(at.*)__builtin_delete/$1...operator delete.../;
34    s/(at.*)operator delete\(void\*\)/$1...operator delete.../;
35
36    s/(at.*)__builtin_vec_delete/$1...operator delete[].../;
37    s/(at.*)operator delete\[\]\(void\*\)/$1...operator delete[].../;
38
39    # Some glibc versions complain about unexpected futex syscall errors.
40    s/The futex facility returned an unexpected error code.//;
41
42    print;
43}
44
45exit 0;
46