diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-14 00:27:34 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-14 00:27:34 +0000 |
commit | a8ad121be1440e1daf093999c5636841cb369a64 (patch) | |
tree | acb12be2c10e259ee4119fe4d27cdbdf2846ef03 /tools | |
parent | de3013a5b2d0538d7ce7f074f2f345b6dd361ae7 (diff) | |
download | chromium_src-a8ad121be1440e1daf093999c5636841cb369a64.zip chromium_src-a8ad121be1440e1daf093999c5636841cb369a64.tar.gz chromium_src-a8ad121be1440e1daf093999c5636841cb369a64.tar.bz2 |
wine_valgrind: Check in a couple local changes to valgrind.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/542060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36200 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r-- | tools/wine_valgrind/valgrind_skip_python.patch | 27 | ||||
-rw-r--r-- | tools/wine_valgrind/valgrind_stop_frame.patch | 147 |
2 files changed, 174 insertions, 0 deletions
diff --git a/tools/wine_valgrind/valgrind_skip_python.patch b/tools/wine_valgrind/valgrind_skip_python.patch new file mode 100644 index 0000000..e5bafd7 --- /dev/null +++ b/tools/wine_valgrind/valgrind_skip_python.patch @@ -0,0 +1,27 @@ +This patch prevents valgrind from tracing into python.exe. +TODO(thestig) generalize this and submit upstream for +https://bugs.kde.org/show_bug.cgi?id=218689 +Index: coregrind/m_syswrap/syswrap-generic.c +=================================================================== +--- coregrind/m_syswrap/syswrap-generic.c (revision 10880) ++++ coregrind/m_syswrap/syswrap-generic.c (working copy) +@@ -2544,6 +2544,19 @@ + VG_(nuke_all_threads_except)( tid, VgSrc_ExitThread ); + VG_(reap_threads)(tid); + ++ if (VG_(clo_trace_children)) { ++ Char** program_args = (Char**)ARG2; ++ if (program_args && program_args[0]) { ++ Int k = 1; ++ for (; program_args[k]; k++) { ++ if (VG_(strstr)(program_args[k], "python.exe") != NULL) { ++ VG_(clo_trace_children) = False; ++ break; ++ } ++ } ++ } ++ } ++ + // Set up the child's exe path. + // + if (VG_(clo_trace_children)) { diff --git a/tools/wine_valgrind/valgrind_stop_frame.patch b/tools/wine_valgrind/valgrind_stop_frame.patch new file mode 100644 index 0000000..1e3d71d --- /dev/null +++ b/tools/wine_valgrind/valgrind_stop_frame.patch @@ -0,0 +1,147 @@ +This patch adds a "STOP" frame to valgrind suppressions +so we can do exact matches. This is filed as +https://bugs.kde.org/show_bug.cgi?id=222604 +TODO(thestig) update the matcher spec and submit upstream. +Index: include/pub_tool_seqmatch.h +=================================================================== +--- include/pub_tool_seqmatch.h (revision 10880) ++++ include/pub_tool_seqmatch.h (working copy) +@@ -76,6 +76,7 @@ + void* input, SizeT szbInput, UWord nInput, UWord ixInput, + Bool (*pIsStar)(void*), + Bool (*pIsQuery)(void*), ++ Bool (*pIsStop)(void*), + Bool (*pattEQinp)(void*,void*) + ); + +Index: coregrind/m_errormgr.c +=================================================================== +--- coregrind/m_errormgr.c (revision 10880) ++++ coregrind/m_errormgr.c (working copy) +@@ -194,7 +194,8 @@ + NoName, /* Error case */ + ObjName, /* Name is of an shared object file. */ + FunName, /* Name is of a function. */ +- DotDotDot /* Frame-level wildcard */ ++ DotDotDot, /* Frame-level wildcard */ ++ STOP /* STOP sign */ + } + SuppLocTy; + +@@ -1074,6 +1075,11 @@ + p->ty = DotDotDot; + return True; + } ++ if (VG_(strcmp)(p->name, "STOP") == 0) { ++ p->name = NULL; ++ p->ty = STOP; ++ return True; ++ } + VG_(printf)("location should be \"...\", or should start " + "with \"fun:\" or \"obj:\"\n"); + return False; +@@ -1243,13 +1249,17 @@ + } while (!eof && !VG_STREQ(buf, "}")); + } + +- // Reject entries which are entirely composed of frame +- // level wildcards. + vg_assert(i > 0); // guaranteed by frame-descriptor reading loop ++ // Reject any pattern where STOP is not the last entry. ++ for (j = 0; j < i - 1; j++) { ++ if (tmp_callers[j].ty == STOP) ++ BOMB("STOP must be the last entry in a suppression"); ++ } ++ // Reject entries which are entirely composed of frame level wildcards. + for (j = 0; j < i; j++) { + if (tmp_callers[j].ty == FunName || tmp_callers[j].ty == ObjName) + break; +- vg_assert(tmp_callers[j].ty == DotDotDot); ++ vg_assert(tmp_callers[j].ty == DotDotDot || tmp_callers[j].ty == STOP); + } + vg_assert(j >= 0 && j <= i); + if (j == i) { +@@ -1324,6 +1334,12 @@ + return False; /* there's no '?' equivalent in the supp syntax */ + } + ++static Bool supploc_IsStop ( void* supplocV ) ++{ ++ SuppLoc* supploc = (SuppLoc*)supplocV; ++ return supploc->ty == STOP; ++} ++ + static Bool supp_pattEQinp ( void* supplocV, void* addrV ) + { + SuppLoc* supploc = (SuppLoc*)supplocV; /* PATTERN */ +@@ -1340,6 +1356,8 @@ + should never get called with a pattern value for which the + _IsStar or _IsQuery function would return True. Hence + this can't happen. */ ++ case STOP: ++ // Ditto. + vg_assert(0); + case ObjName: + /* Get the object name into 'caller_name', or "???" +@@ -1389,7 +1407,7 @@ + matchAll, + /*PATT*/supps, szbPatt, n_supps, 0/*initial Ix*/, + /*INPUT*/ips, szbInput, n_ips, 0/*initial Ix*/, +- supploc_IsStar, supploc_IsQuery, supp_pattEQinp ++ supploc_IsStar, supploc_IsQuery, supploc_IsStop, supp_pattEQinp + ); + } + +Index: coregrind/m_seqmatch.c +=================================================================== +--- coregrind/m_seqmatch.c (revision 10880) ++++ coregrind/m_seqmatch.c (working copy) +@@ -45,6 +45,7 @@ + void* input, SizeT szbInput, UWord nInput, UWord ixInput, + Bool (*pIsStar)(void*), + Bool (*pIsQuery)(void*), ++ Bool (*pIsStop)(void*), + Bool (*pattEQinp)(void*,void*) + ) + { +@@ -102,7 +103,7 @@ + if (VG_(generic_match)( matchAll, + patt, szbPatt, nPatt, ixPatt+1, + input,szbInput,nInput, ixInput+0, +- pIsStar,pIsQuery,pattEQinp) ) { ++ pIsStar,pIsQuery,pIsStop,pattEQinp) ) { + return True; + } + // but we can tail-recurse for the second call +@@ -125,6 +126,9 @@ + } + } + ++ if (havePatt && pIsStop(currPatt)) ++ return !haveInput; ++ + // obvious case with literal chars in the pattern + // + // ma (p:ps) (i:is) = p == i && ma ps is +@@ -163,10 +167,11 @@ + */ + static Bool charIsStar ( void* pV ) { return *(Char*)pV == '*'; } + static Bool charIsQuery ( void* pV ) { return *(Char*)pV == '?'; } ++static Bool charIsStop ( void* pV ) { return *(Char*)pV == '!'; } + static Bool char_p_EQ_i ( void* pV, void* cV ) { + Char p = *(Char*)pV; + Char c = *(Char*)cV; +- vg_assert(p != '*' && p != '?'); ++ vg_assert(p != '*' && p != '?' && p != '!'); + return p == c; + } + Bool VG_(string_match) ( const Char* patt, const Char* input ) +@@ -175,7 +180,7 @@ + True/* match-all */, + (void*)patt, sizeof(UChar), VG_(strlen)(patt), 0, + (void*)input, sizeof(UChar), VG_(strlen)(input), 0, +- charIsStar, charIsQuery, char_p_EQ_i ++ charIsStar, charIsQuery, charIsStop, char_p_EQ_i + ); + } + |