From: Julian Seward Date: Sun, 24 Mar 2002 09:45:26 +0000 (+0000) Subject: (merge from 20020320) X-Git-Tag: svn/VALGRIND_1_0_3~435 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db5f7ae5a82f38c9b54519bbb5e82b946c340ecd;p=thirdparty%2Fvalgrind.git (merge from 20020320) Allow suppressions with only a single level of backtrace, for suppressing against libraries compiled with -fomit-frame-pointer. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11 --- diff --git a/coregrind/vg_errcontext.c b/coregrind/vg_errcontext.c index 42e09b53a5..46a581eabe 100644 --- a/coregrind/vg_errcontext.c +++ b/coregrind/vg_errcontext.c @@ -865,26 +865,30 @@ static void load_one_suppressions_file ( Char* filename ) if (!setLocationTy(&(supp->caller0), &(supp->caller0_ty))) goto syntax_error; - eof = getLine ( fd, buf, N_BUF ); - if (eof) goto syntax_error; - supp->caller1 = copyStr(buf); - if (!setLocationTy(&(supp->caller1), &(supp->caller1_ty))) - goto syntax_error; - eof = getLine ( fd, buf, N_BUF ); if (eof) goto syntax_error; if (!STREQ(buf, "}")) { - supp->caller2 = copyStr(buf); - if (!setLocationTy(&(supp->caller2), &(supp->caller2_ty))) + supp->caller1 = copyStr(buf); + if (!setLocationTy(&(supp->caller1), &(supp->caller1_ty))) goto syntax_error; + eof = getLine ( fd, buf, N_BUF ); if (eof) goto syntax_error; if (!STREQ(buf, "}")) { - supp->caller3 = copyStr(buf); - if (!setLocationTy(&(supp->caller3), &(supp->caller3_ty))) + supp->caller2 = copyStr(buf); + if (!setLocationTy(&(supp->caller2), &(supp->caller2_ty))) goto syntax_error; + eof = getLine ( fd, buf, N_BUF ); - if (eof || !STREQ(buf, "}")) goto syntax_error; + if (eof) goto syntax_error; + if (!STREQ(buf, "}")) { + supp->caller3 = copyStr(buf); + if (!setLocationTy(&(supp->caller3), &(supp->caller3_ty))) + goto syntax_error; + + eof = getLine ( fd, buf, N_BUF ); + if (eof || !STREQ(buf, "}")) goto syntax_error; + } } } @@ -1020,14 +1024,17 @@ static Suppression* is_suppressible_error ( ErrContext* ec ) default: goto baaaad; } - switch (su->caller1_ty) { - case ObjName: if (!VG_(stringMatch)(su->caller1, - caller1_obj)) continue; - break; - case FunName: if (!VG_(stringMatch)(su->caller1, - caller1_fun)) continue; - break; - default: goto baaaad; + if (su->caller1 != NULL) { + vg_assert(VG_(clo_backtrace_size) >= 2); + switch (su->caller1_ty) { + case ObjName: if (!VG_(stringMatch)(su->caller1, + caller1_obj)) continue; + break; + case FunName: if (!VG_(stringMatch)(su->caller1, + caller1_fun)) continue; + break; + default: goto baaaad; + } } if (VG_(clo_backtrace_size) > 2 && su->caller2 != NULL) { diff --git a/vg_errcontext.c b/vg_errcontext.c index 42e09b53a5..46a581eabe 100644 --- a/vg_errcontext.c +++ b/vg_errcontext.c @@ -865,26 +865,30 @@ static void load_one_suppressions_file ( Char* filename ) if (!setLocationTy(&(supp->caller0), &(supp->caller0_ty))) goto syntax_error; - eof = getLine ( fd, buf, N_BUF ); - if (eof) goto syntax_error; - supp->caller1 = copyStr(buf); - if (!setLocationTy(&(supp->caller1), &(supp->caller1_ty))) - goto syntax_error; - eof = getLine ( fd, buf, N_BUF ); if (eof) goto syntax_error; if (!STREQ(buf, "}")) { - supp->caller2 = copyStr(buf); - if (!setLocationTy(&(supp->caller2), &(supp->caller2_ty))) + supp->caller1 = copyStr(buf); + if (!setLocationTy(&(supp->caller1), &(supp->caller1_ty))) goto syntax_error; + eof = getLine ( fd, buf, N_BUF ); if (eof) goto syntax_error; if (!STREQ(buf, "}")) { - supp->caller3 = copyStr(buf); - if (!setLocationTy(&(supp->caller3), &(supp->caller3_ty))) + supp->caller2 = copyStr(buf); + if (!setLocationTy(&(supp->caller2), &(supp->caller2_ty))) goto syntax_error; + eof = getLine ( fd, buf, N_BUF ); - if (eof || !STREQ(buf, "}")) goto syntax_error; + if (eof) goto syntax_error; + if (!STREQ(buf, "}")) { + supp->caller3 = copyStr(buf); + if (!setLocationTy(&(supp->caller3), &(supp->caller3_ty))) + goto syntax_error; + + eof = getLine ( fd, buf, N_BUF ); + if (eof || !STREQ(buf, "}")) goto syntax_error; + } } } @@ -1020,14 +1024,17 @@ static Suppression* is_suppressible_error ( ErrContext* ec ) default: goto baaaad; } - switch (su->caller1_ty) { - case ObjName: if (!VG_(stringMatch)(su->caller1, - caller1_obj)) continue; - break; - case FunName: if (!VG_(stringMatch)(su->caller1, - caller1_fun)) continue; - break; - default: goto baaaad; + if (su->caller1 != NULL) { + vg_assert(VG_(clo_backtrace_size) >= 2); + switch (su->caller1_ty) { + case ObjName: if (!VG_(stringMatch)(su->caller1, + caller1_obj)) continue; + break; + case FunName: if (!VG_(stringMatch)(su->caller1, + caller1_fun)) continue; + break; + default: goto baaaad; + } } if (VG_(clo_backtrace_size) > 2 && su->caller2 != NULL) {