|
From: <sv...@va...> - 2005-08-18 16:56:44
|
Author: njn
Date: 2005-08-18 16:49:21 +0100 (Thu, 18 Aug 2005)
New Revision: 4447
Log:
Make it possible to match against "???" line in suppressions,
using "obj:*" or "fun:*". Also generate "obj:*" for such lines
with --gen-suppressions. Includes a regtest.
Added:
trunk/memcheck/tests/supp_unknown.stderr.exp
trunk/memcheck/tests/supp_unknown.supp
trunk/memcheck/tests/supp_unknown.vgtest
Modified:
trunk/coregrind/m_errormgr.c
trunk/memcheck/tests/Makefile.am
Modified: trunk/coregrind/m_errormgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_errormgr.c 2005-08-18 11:55:37 UTC (rev 4446)
+++ trunk/coregrind/m_errormgr.c 2005-08-18 15:49:21 UTC (rev 4447)
@@ -391,8 +391,7 @@
} else if ( VG_(get_objname)(ip, buf, ERRTXT_LEN) ) {
VG_(printf)(" obj:%s\n", buf);
} else {
- VG_(printf)(" ???:??? "
- "# unknown, suppression will not work, sorry\n");
+ VG_(printf)(" obj:*\n");
}
}
=20
@@ -1093,16 +1092,20 @@
for (i =3D 0; i < su->n_callers; i++) {
Addr a =3D ips[i];
vg_assert(su->callers[i].name !=3D NULL);
+ // The string to be used in the unknown case ("???") can be anythi=
ng
+ // that couldn't be a valid function or objname. --gen-suppressio=
ns
+ // prints 'obj:*' for such an entry, which will match any string w=
e
+ // use.
switch (su->callers[i].ty) {
case ObjName:=20
if (!VG_(get_objname)(a, caller_name, ERRTXT_LEN))
- return False;
+ VG_(strcpy)(caller_name, "???");
break;=20
=20
case FunName:=20
// Nb: mangled names used in suppressions
if (!VG_(get_fnname_nodemangle)(a, caller_name, ERRTXT_LEN))
- return False;
+ VG_(strcpy)(caller_name, "???");
break;
default: VG_(tool_panic)("supp_matches_callers");
}
Modified: trunk/memcheck/tests/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/Makefile.am 2005-08-18 11:55:37 UTC (rev 4446)
+++ trunk/memcheck/tests/Makefile.am 2005-08-18 15:49:21 UTC (rev 4447)
@@ -76,6 +76,7 @@
stack_changes.stderr.exp stack_changes.stdout.exp stack_changes.vgtest =
\
strchr.stderr.exp strchr.vgtest \
str_tester.stderr.exp str_tester.vgtest \
+ supp_unknown.stderr.exp supp_unknown.vgtest supp_unknown.supp \
supp1.stderr.exp supp1.vgtest \
supp2.stderr.exp supp2.vgtest \
supp.supp \
@@ -110,7 +111,7 @@
post-syscall \
realloc1 realloc2 realloc3 \
sigaltstack signal2 sigprocmask sigkill \
- stack_changes strchr str_tester supp1 supp2 suppfree \
+ stack_changes strchr str_tester supp_unknown supp1 supp2 suppfree \
trivialleak weirdioctl \
mismatches new_override metadata \
vgtest_ume xml1 \
@@ -127,6 +128,7 @@
# Don't allow GCC to inline memcpy(), because then we can't intercept it
overlap_CFLAGS =3D $(AM_CFLAGS) -fno-builtin-memcpy
str_tester_CFLAGS =3D $(AM_CFLAGS) -Wno-shadow
+supp_unknown_SOURCES =3D badjump.c
supp1_SOURCES =3D supp.c
supp2_SOURCES =3D supp.c
=20
Added: trunk/memcheck/tests/supp_unknown.stderr.exp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/supp_unknown.stderr.exp 2005-08-18 11:55:37 UTC =
(rev 4446)
+++ trunk/memcheck/tests/supp_unknown.stderr.exp 2005-08-18 15:49:21 UTC =
(rev 4447)
@@ -0,0 +1,6 @@
+
+Process terminating with default action of signal 11 (SIGSEGV)
+ Access not within mapped region at address 0x........
+ at 0x........: ???
+ by 0x........: __libc_start_main (in /...libc...)
+ by 0x........: ...
Added: trunk/memcheck/tests/supp_unknown.supp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/supp_unknown.supp 2005-08-18 11:55:37 UTC (rev 4=
446)
+++ trunk/memcheck/tests/supp_unknown.supp 2005-08-18 15:49:21 UTC (rev 4=
447)
@@ -0,0 +1,8 @@
+# This contains a match against a "???" entry
+{
+ <insert a suppression name here>
+ Memcheck:Addr1
+ obj:*
+ fun:__libc_start_main
+}
+
Added: trunk/memcheck/tests/supp_unknown.vgtest
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/supp_unknown.vgtest 2005-08-18 11:55:37 UTC (rev=
4446)
+++ trunk/memcheck/tests/supp_unknown.vgtest 2005-08-18 15:49:21 UTC (rev=
4447)
@@ -0,0 +1,3 @@
+vgopts: -q --suppressions=3Dsupp_unknown.supp
+prog: badjump
+cleanup: rm -f vgcore.pid*
|