ftmemsim-valgrind/tests/filter_libc
Nicholas Nethercote 07045477ca Merge the DARWIN branch onto the trunk.
I tried using 'svn merge' to do the merge but it did a terrible job and
there were bazillions of conflicts.  So instead I just took the diff between
the branch and trunk  at r10155, applied the diff to the trunk, 'svn add'ed
the added files (no files needed to be 'svn remove'd) and committed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10156
2009-05-28 01:53:07 +00:00

49 lines
1.6 KiB
Perl
Executable File

#! /usr/bin/perl -w
use strict;
my @libc_symbols = qw(__libc_start_main accept execve fcntl
getsockname poll readv recvmsg
socket socketpair syscall writev);
my $libc_symbols = join("|", @libc_symbols);
while (<>)
{
s/ __getsockname / getsockname /;
s/ __sigaction / sigaction /;
s/ __GI___/ __/;
s/ __([a-z]*)_nocancel / $1 /;
# "libSystem*" occurs on Darwin.
s/\(in \/.*(libc|libSystem).*\)$/(in \/...libc...)/;
s/\(within \/.*(libc|libSystem).*\)$/(within \/...libc...)/;
# Remove the filename -- on some platforms (eg. Linux) it will be in
# libc, on some (eg. Darwin) it will be in the main executable.
s/\(below main\) \(.+\)$/(below main)/;
s/($libc_symbols) \(.+\.[cS]:\d+\)$/$1 (in \/...libc...)/;
# Merge the different C++ operator variations.
s/(at.*)__builtin_new/$1...operator new.../;
s/(at.*)operator new\(unsigned(| int| long)\)/$1...operator new.../;
s/(at.*)__builtin_vec_new/$1...operator new.../;
s/(at.*)operator new\[\]\(unsigned(| int| long)\)/$1...operator new[].../;
s/(at.*)__builtin_delete/$1...operator delete.../;
s/(at.*)operator delete\(void\*\)/$1...operator delete.../;
s/(at.*)__builtin_vec_delete/$1...operator delete[].../;
s/(at.*)operator delete\[\]\(void\*\)/$1...operator delete[].../;
# Tidy up in cases where glibc (+ libdl + libpthread + ld) have
# been built with debugging information, hence source locs are present.
s/\((exit|_exit|brk|sbrk).c:[0-9]*\)/(in \/...libc...)/;
print;
}
exit 0;