/
niceSOFT
/
valgrind
Обзор
Документация
Войти
/
niceSOFT
/
valgrind
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/filter_libc
69 строк
2 KB
Paul Floyd
FreeBSD regtest: add a (below main) filter for one of the massif tests.
12 апр 2026, 17:36
12 апр 2026, 17:36
f83b072
Код
Авторство
О чём код?
#!/usr/bin/env perl use strict; use warnings; while (<>) { s/ __getsockname / getsockname /; s/ __sigaction / sigaction /; s/ __GI___/ __/; s/ __([a-z]*)_nocancel / $1 /; # "lib[S|s]ystem*" occurs on Darwin, "libsocket" on older Solaris/illumos. s/\(in \/.*(libc|libSystem|libsystem|libsocket|libsys).*\)$/(in \/...libc...)/; s/\(within \/.*(libc|libSystem|libsystem|libsocket).*\)$/(within \/...libc...)/; # From assembler functions s/\(syscall-template.S:.*\)$/(in \/...libc...)/; # Filter out dynamic loader s/ \(in \/.*ld-.*so\)$//; # 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/start \(in \/usr\/lib\/system\/libdyld.dylib\)/(below main)/; # libc on x86 FreeBSD s#_start1 \(src/lib/csu/i386/crt1_c.c.*#(below main)#; s#__libc_start1 \(in /...libc...\)#(below main)#; # FreeBSD when installed from source rather than binary packages # generated assembler results in things like # write (write.S:4) s#: (\w+) \(\1\.S:\d+\)#: $1 (in /...libc...)#; # not all follow that pattern so need to be done explicitly s#(?:__mac_get_file|syscall|_open)\.S:\d+#in /...libc...#; s#\(.*/lib/libsys/libsys_.*\)#(in /...libc...)#; s#\(.*/lib/libc/sys/.*\.c:\d+\)#(in /...libc...)#; s#__libc_start1 \(.*lib/libc/csu/libc_start1\.c:\d+\)#(below main)#; # on Illumos s#_start_crt \(in .*#(below main)#; # filter out the exact libc-start.c:### line number. (ppc64*) s/\(libc-start.c:[0-9]*\)$/(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\*(, unsigned(| int| long))?\)/$1...operator delete.../; s/(at.*)__builtin_vec_delete/$1...operator delete[].../; s/(at.*)operator delete\[\]\(void\*\)/$1...operator delete[].../; # Some glibc versions complain about unexpected futex syscall errors. # With or without newline (see sourceware PR20271). next if /^The futex facility returned an unexpected error code.$/; s/The futex facility returned an unexpected error code.//; print; } exit 0;