ftmemsim-valgrind/tests/filter_libc
Nicholas Nethercote f3240d6950 Filter out everything after "(below main)" in a line. This will help with
Darwin, for which such entries can occur within the executable, rather than
within libc.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9142
2009-02-12 00:51:50 +00:00

31 lines
764 B
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 /;
s/\(in \/.*libc.*\)$/(in \/...libc...)/;
s/\(within \/.*libc.*\)$/(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...)/;
print;
}
exit 0;