|
From: <sv...@va...> - 2005-08-19 00:14:24
|
Author: dirk
Date: 2005-08-19 01:13:52 +0100 (Fri, 19 Aug 2005)
New Revision: 4451
Log:
backport suppression handling fix
Added:
branches/VALGRIND_3_0_BRANCH/memcheck/tests/supp_unknown.stderr.exp
branches/VALGRIND_3_0_BRANCH/memcheck/tests/supp_unknown.supp
branches/VALGRIND_3_0_BRANCH/memcheck/tests/supp_unknown.vgtest
Modified:
branches/VALGRIND_3_0_BRANCH/coregrind/m_errormgr.c
branches/VALGRIND_3_0_BRANCH/memcheck/mac_shared.c
branches/VALGRIND_3_0_BRANCH/memcheck/tests/Makefile.am
Modified: branches/VALGRIND_3_0_BRANCH/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
--- branches/VALGRIND_3_0_BRANCH/coregrind/m_errormgr.c 2005-08-19 00:06:=
39 UTC (rev 4450)
+++ branches/VALGRIND_3_0_BRANCH/coregrind/m_errormgr.c 2005-08-19 00:13:=
52 UTC (rev 4451)
@@ -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
@@ -1089,16 +1088,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: branches/VALGRIND_3_0_BRANCH/memcheck/mac_shared.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
--- branches/VALGRIND_3_0_BRANCH/memcheck/mac_shared.c 2005-08-19 00:06:3=
9 UTC (rev 4450)
+++ branches/VALGRIND_3_0_BRANCH/memcheck/mac_shared.c 2005-08-19 00:13:5=
2 UTC (rev 4451)
@@ -437,7 +437,7 @@
putting the result in ai. */
static void describe_addr ( Addr a, AddrInfo* ai )
{
- MAC_Chunk* sc;
+ MAC_Chunk* mc;
ThreadId tid;
=20
/* Perhaps it's a user-def'd block ? (only check if requested, thoug=
h) */
@@ -453,21 +453,21 @@
return;
}
/* Search for a recently freed block which might bracket it. */
- sc =3D MAC_(first_matching_freed_MAC_Chunk)(addr_is_in_MAC_Chunk, &a)=
;
- if (NULL !=3D sc) {
+ mc =3D MAC_(first_matching_freed_MAC_Chunk)(addr_is_in_MAC_Chunk, &a)=
;
+ if (NULL !=3D mc) {
ai->akind =3D Freed;
- ai->blksize =3D sc->size;
- ai->rwoffset =3D (Int)a - (Int)sc->data;
- ai->lastchange =3D sc->where;
+ ai->blksize =3D mc->size;
+ ai->rwoffset =3D (Int)a - (Int)mc->data;
+ ai->lastchange =3D mc->where;
return;
}
/* Search for a currently malloc'd block which might bracket it. */
- sc =3D (MAC_Chunk*)VG_(HT_first_match)(MAC_(malloc_list), addr_is_in_=
HashNode, &a);
- if (NULL !=3D sc) {
+ mc =3D (MAC_Chunk*)VG_(HT_first_match)(MAC_(malloc_list), addr_is_in_=
HashNode, &a);
+ if (NULL !=3D mc) {
ai->akind =3D Mallocd;
- ai->blksize =3D sc->size;
- ai->rwoffset =3D (Int)(a) - (Int)sc->data;
- ai->lastchange =3D sc->where;
+ ai->blksize =3D mc->size;
+ ai->rwoffset =3D (Int)(a) - (Int)mc->data;
+ ai->lastchange =3D mc->where;
return;
}
/* Clueless ... */
Modified: branches/VALGRIND_3_0_BRANCH/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
--- branches/VALGRIND_3_0_BRANCH/memcheck/tests/Makefile.am 2005-08-19 00=
:06:39 UTC (rev 4450)
+++ branches/VALGRIND_3_0_BRANCH/memcheck/tests/Makefile.am 2005-08-19 00=
:13:52 UTC (rev 4451)
@@ -74,6 +74,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 \
@@ -108,7 +109,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 \
@@ -124,6 +125,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
Copied: branches/VALGRIND_3_0_BRANCH/memcheck/tests/supp_unknown.stderr.e=
xp (from rev 4447, trunk/memcheck/tests/supp_unknown.stderr.exp)
Copied: branches/VALGRIND_3_0_BRANCH/memcheck/tests/supp_unknown.supp (fr=
om rev 4447, trunk/memcheck/tests/supp_unknown.supp)
Copied: branches/VALGRIND_3_0_BRANCH/memcheck/tests/supp_unknown.vgtest (=
from rev 4447, trunk/memcheck/tests/supp_unknown.vgtest)
|