--- valgrind-2.4.0/coregrind/vg_errcontext.c 2005-03-11 00:28:10.000000000 -0600 +++ valgrind-2.4.0-supp-src-patch/coregrind/vg_errcontext.c 2005-07-24 12:19:11.000000000 -0500 @@ -135,7 +135,8 @@ enum { NoName, /* Error case */ ObjName, /* Name is of an shared object file. */ - FunName /* Name is of a function. */ + FunName, /* Name is of a function. */ + SrcName /* Name is of a src file */ } SuppLocTy; @@ -143,6 +144,7 @@ struct { SuppLocTy ty; Char* name; + UInt lineno; } SuppLoc; @@ -749,6 +751,8 @@ */ static Bool setLocationTy ( SuppLoc* p ) { + Char * s; + if (VG_(strncmp)(p->name, "fun:", 4) == 0) { p->name += 4; p->ty = FunName; @@ -759,7 +763,23 @@ p->ty = ObjName; return True; } - VG_(printf)("location should start with fun: or obj:\n"); + if (VG_(strncmp)(p->name, "src:", 4) == 0) { + p->name += 4; + p->ty = SrcName; + p->lineno = 0; + if ((s = VG_(strchr)(p->name, ':'))) + { + *s++ = 0; + while (*s) + { + p->lineno *= 10; + p->lineno += *s++ - '0'; + } + } + + return True; + } + VG_(printf)("location should start with fun:, obj:, or src:\n"); return False; } @@ -898,7 +918,7 @@ break; tmp_callers[i].name = VG_(arena_strdup)(VG_AR_CORE, buf); if (!setLocationTy(&(tmp_callers[i]))) - BOMB("location should start with 'fun:' or 'obj:'"); + BOMB("location should start with 'fun:', 'obj:', 'src:'"); i++; } @@ -972,6 +992,7 @@ Bool supp_matches_callers(Error* err, Supp* su) { Int i; + UInt line; Char caller_name[M_VG_ERRTXT]; for (i = 0; i < su->n_callers; i++) { @@ -988,6 +1009,12 @@ if (!VG_(get_fnname_nodemangle)(a, caller_name, M_VG_ERRTXT)) return False; break; + case SrcName: + if (!VG_(get_filename_linenum)(a, caller_name, M_VG_ERRTXT, &line)) + return False; + if (su->callers[i].lineno != 0 && su->callers[i].lineno != line) + return False; + break; default: VG_(skin_panic)("supp_matches_callers"); } if (!VG_(string_match)(su->callers[i].name, caller_name))