From: Julian Seward Date: Tue, 28 Nov 2006 00:15:35 +0000 (+0000) Subject: Make it possible to suppress, and auto-generate suppressions for, X-Git-Tag: svn/VALGRIND_3_3_0~511 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fe15db88312df778f0147f55794220e0d914c6c;p=thirdparty%2Fvalgrind.git Make it possible to suppress, and auto-generate suppressions for, "User" errors; that is, errors resulting from client requests (check memory range is addressible / defined). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6374 --- diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index fb6706cbe7..f9ccd0322c 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -2648,6 +2648,7 @@ typedef typedef enum { ParamSupp, // Bad syscall params + UserSupp, // Errors arising from client-request checks CoreMemSupp, // Memory errors in core (pthread ops, signal handling) // Use of invalid values of given size (MemCheck only) @@ -3357,6 +3358,7 @@ static Bool mc_recognised_suppression ( Char* name, Supp* su ) SuppKind skind; if (VG_STREQ(name, "Param")) skind = ParamSupp; + else if (VG_STREQ(name, "User")) skind = UserSupp; else if (VG_STREQ(name, "CoreMem")) skind = CoreMemSupp; else if (VG_STREQ(name, "Addr1")) skind = Addr1Supp; else if (VG_STREQ(name, "Addr2")) skind = Addr2Supp; @@ -3406,6 +3408,9 @@ static Bool mc_error_matches_suppression(Error* err, Supp* su) && VG_STREQ(VG_(get_error_string)(err), VG_(get_supp_string)(su))); + case UserSupp: + return (ekind == UserErr); + case CoreMemSupp: return (ekind == CoreMemErr && VG_STREQ(VG_(get_error_string)(err), @@ -3454,7 +3459,7 @@ static Char* mc_get_error_name ( Error* err ) Char* s; switch (VG_(get_error_kind)(err)) { case ParamErr: return "Param"; - case UserErr: return NULL; /* Can't suppress User errors */ + case UserErr: return "User"; case FreeMismatchErr: return "Free"; case IllegalMempoolErr: return "Mempool"; case FreeErr: return "Free";