]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
* add some assertions to frame-level wildcarding mechanism
authorJulian Seward <jseward@acm.org>
Tue, 4 Nov 2008 11:29:19 +0000 (11:29 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 4 Nov 2008 11:29:19 +0000 (11:29 +0000)
* remove a couple of tabs

* clarify related documentation a bit

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8727

coregrind/m_errormgr.c
docs/xml/manual-core.xml

index 2e408436f83d1a8a77656202eb1214d2ca4a3622..90560adc5812dba83c5191a805c2fcc68ab234bd 100644 (file)
@@ -1133,7 +1133,7 @@ static void load_one_suppressions_file ( Char* filename )
    if (VG_(clo_xml))
       VG_(message)(Vg_UserMsg, "</valgrindoutput>\n");
    VG_(message)(Vg_UserMsg, 
-                "FATAL: in suppressions file \"%s\" around line %d:",
+                "FATAL: in suppressions file \"%s\" near line %d:",
                 filename, lineno );
    VG_(message)(Vg_UserMsg, 
                 "   %s", err_str );
@@ -1190,6 +1190,7 @@ Bool supp_matches_callers_WRK ( StackTrace trace, Int n_ips,
    Int i, j;
    static Char caller_name[ERRTXT_LEN]; /* NOT IN FRAME */
 
+   vg_assert(n_ips > 0 && n_callers > 0);
    i = j = 0;
    while (i < n_callers) {
       Addr a = trace[j];
@@ -1209,6 +1210,7 @@ Bool supp_matches_callers_WRK ( StackTrace trace, Int n_ips,
                VG_(strcpy)(caller_name, "???");
             break;
          case DotDotDot:
+            caller_name[0] = 0; /* precautionary */
             break;
          default:
             VG_(tool_panic)("supp_wildmatch_callers");
@@ -1219,16 +1221,17 @@ Bool supp_matches_callers_WRK ( StackTrace trace, Int n_ips,
          /* Handle frame-level wildcard case */
          Char *lookahead;
 
-        // collapse subsequent wildcards
-        while (i < n_callers && callers[i].ty == DotDotDot)
+         // collapse subsequent wildcards
+         while (i < n_callers && callers[i].ty == DotDotDot)
             ++i;
-        --i;
+         --i;
 
          if (i == n_callers-1)
             // wildcard at the top, doesn't matter
             return True;
 
-        lookahead = callers[i+1].name;
+         vg_assert(i >= 0 && i+1 < n_callers);
+         lookahead = callers[i+1].name;
          while (j < n_ips) {
             static Char tmp[ERRTXT_LEN]; /* NOT IN FRAME */
 
index a413c37ff23ef42fa077b17268d3da4f0d32dfec..d09055947001e9a169be5ec26ced2794071edef7 100644 (file)
@@ -365,7 +365,12 @@ them.</para>
 
 <formalpara><title>Note:</title> <para>By far the easiest way to add
 suppressions is to use the <option>--gen-suppressions=yes</option> flag
-described in <xref linkend="manual-core.flags"/>.</para>
+described in <xref linkend="manual-core.flags"/>.  This generates
+suppressions automatically.  For best results,
+though, you may want to edit the output
+    of  <option>--gen-suppressions=yes</option> by hand, in which
+case it would be advisable to read through this section.
+</para>
 </formalpara>
 
 <para>Each error to be suppressed is described very specifically, to
@@ -953,8 +958,15 @@ that can report errors, e.g. Memcheck, but not Cachegrind.</para>
       required.</para>
 
       <para>Note that the suppressions printed are as specific as
-      possible.  You may want to common up similar ones, eg. by adding
-      wildcards to function names.  Sometimes two different errors
+      possible.  You may want to common up similar ones, by adding
+      wildcards to function names, and by using frame-level wildcards.
+      The wildcarding facilities are powerful yet flexible, and with a
+      bit of careful editing, you may be able to suppress a whole
+      family of related errors with only a few suppressions.  For
+      details on how to do this, see
+      <xref linkend="manual-core.suppress"/>.</para>
+
+      <para>Sometimes two different errors
       are suppressed by the same suppression, in which case Valgrind
       will output the suppression more than once, but you only need to
       have one copy in your suppression file (but having more than one
@@ -1445,7 +1457,7 @@ will create a core dump in the usual way.</para>
 <computeroutput>make</computeroutput>, <computeroutput>make
 install</computeroutput> mechanism, and we have attempted to
 ensure that it works on machines with kernel 2.4 or 2.6 and glibc
-2.2.X to 2.5.X.  Once you have completed 
+2.2.X to 2.9.X.  Once you have completed 
 <computeroutput>make install</computeroutput> you may then want 
 to run the regression tests
 with <computeroutput>make regtest</computeroutput>.