]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Make --leak-check observe -q properly -- only prints out errors, not general
authorNicholas Nethercote <n.nethercote@gmail.com>
Tue, 2 Dec 2003 10:17:44 +0000 (10:17 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Tue, 2 Dec 2003 10:17:44 +0000 (10:17 +0000)
info and summaries.

MERGE TO STABLE

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

memcheck/mac_leakcheck.c
memcheck/tests/nanoleak.stderr.exp
memcheck/tests/nanoleak_supp.stderr.exp
memcheck/tests/trivialleak.stderr.exp

index 5084075688e2560d49ee09d7bca9060b97cc12fc..a5966126cc7088fc643e54367fb170bcd65eca4c 100644 (file)
@@ -421,8 +421,10 @@ void MAC_(do_detect_memory_leaks) (
       return;
    }
 
-   VG_(message)(Vg_UserMsg, "searching for pointers to %d not-freed blocks.", 
-                lc_n_shadows );
+   if (VG_(clo_verbosity) > 0)
+      VG_(message)(Vg_UserMsg, 
+                   "searching for pointers to %d not-freed blocks.", 
+                   lc_n_shadows );
 
    lc_min_mallocd_addr = lc_shadows[0]->data;
    lc_max_mallocd_addr = lc_shadows[lc_n_shadows-1]->data
@@ -441,7 +443,8 @@ void MAC_(do_detect_memory_leaks) (
               &vg_detect_memory_leaks_notify_addr
            );
 
-   VG_(message)(Vg_UserMsg, "checked %d bytes.", bytes_notified);
+   if (VG_(clo_verbosity) > 0)
+      VG_(message)(Vg_UserMsg, "checked %d bytes.", bytes_notified);
 
    /* Common up the lost blocks so we can print sensible error messages. */
    n_lossrecords = 0;
@@ -526,23 +529,24 @@ void MAC_(do_detect_memory_leaks) (
       p_min->num_blocks = 0;
    }
 
-   VG_(message)(Vg_UserMsg, "");
-   VG_(message)(Vg_UserMsg, "LEAK SUMMARY:");
-   VG_(message)(Vg_UserMsg, "   definitely lost: %d bytes in %d blocks.", 
-                            MAC_(bytes_leaked), blocks_leaked );
-   VG_(message)(Vg_UserMsg, "   possibly lost:   %d bytes in %d blocks.", 
-                            MAC_(bytes_dubious), blocks_dubious );
-   VG_(message)(Vg_UserMsg, "   still reachable: %d bytes in %d blocks.", 
-                            MAC_(bytes_reachable), blocks_reachable );
-   VG_(message)(Vg_UserMsg, "        suppressed: %d bytes in %d blocks.", 
-                            MAC_(bytes_suppressed), blocks_suppressed );
-   if (!MAC_(clo_show_reachable)) {
-      VG_(message)(Vg_UserMsg, 
-        "Reachable blocks (those to which a pointer was found) are not shown.");
-      VG_(message)(Vg_UserMsg, 
-         "To see them, rerun with: --show-reachable=yes");
+   if (VG_(clo_verbosity) > 0) {
+      VG_(message)(Vg_UserMsg, "");
+      VG_(message)(Vg_UserMsg, "LEAK SUMMARY:");
+      VG_(message)(Vg_UserMsg, "   definitely lost: %d bytes in %d blocks.", 
+                               MAC_(bytes_leaked), blocks_leaked );
+      VG_(message)(Vg_UserMsg, "   possibly lost:   %d bytes in %d blocks.", 
+                               MAC_(bytes_dubious), blocks_dubious );
+      VG_(message)(Vg_UserMsg, "   still reachable: %d bytes in %d blocks.", 
+                               MAC_(bytes_reachable), blocks_reachable );
+      VG_(message)(Vg_UserMsg, "        suppressed: %d bytes in %d blocks.", 
+                               MAC_(bytes_suppressed), blocks_suppressed );
+      if (!MAC_(clo_show_reachable)) {
+         VG_(message)(Vg_UserMsg, 
+           "Reachable blocks (those to which a pointer was found) are not shown.");
+         VG_(message)(Vg_UserMsg, 
+            "To see them, rerun with: --show-reachable=yes");
+      }
    }
-   VG_(message)(Vg_UserMsg, "");
 
    VG_(free) ( lc_shadows );
    VG_(free) ( lc_reachedness );
index 9ed81965ab64ce3485f40e68eee174a98cbe3a6a..57fdf3c3b8761b24e39e42a6b4982dc3e43c40cb 100644 (file)
@@ -1,15 +1,4 @@
-searching for pointers to 1 not-freed blocks.
-checked ... bytes.
 
 1000 bytes in 1 blocks are definitely lost in loss record 1 of 1
    at 0x........: malloc (vg_replace_malloc.c:...)
    by 0x........: main (nanoleak.c:6)
-
-LEAK SUMMARY:
-   definitely lost: 1000 bytes in 1 blocks.
-   possibly lost:   0 bytes in 0 blocks.
-   still reachable: 0 bytes in 0 blocks.
-        suppressed: 0 bytes in 0 blocks.
-Reachable blocks (those to which a pointer was found) are not shown.
-To see them, rerun with: --show-reachable=yes
-
index 3e620b322c14d58b559e91e45f1ba9a6254685cc..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,11 +0,0 @@
-searching for pointers to 1 not-freed blocks.
-checked ... bytes.
-
-LEAK SUMMARY:
-   definitely lost: 0 bytes in 0 blocks.
-   possibly lost:   0 bytes in 0 blocks.
-   still reachable: 0 bytes in 0 blocks.
-        suppressed: 1000 bytes in 1 blocks.
-Reachable blocks (those to which a pointer was found) are not shown.
-To see them, rerun with: --show-reachable=yes
-
index ad41678d5c8c229bd97a7914892b15359f7a6179..1bd6e545f927bd34da383f74f33d71738838dee3 100644 (file)
@@ -1,16 +1,5 @@
-searching for pointers to 1000 not-freed blocks.
-checked ... bytes.
 
 1000 bytes in 1000 blocks are definitely lost in loss record 1 of 1
    at 0x........: malloc (vg_replace_malloc.c:...)
    by 0x........: test (trivialleak.c:8)
    by 0x........: main (trivialleak.c:12)
-
-LEAK SUMMARY:
-   definitely lost: 1000 bytes in 1000 blocks.
-   possibly lost:   0 bytes in 0 blocks.
-   still reachable: 0 bytes in 0 blocks.
-        suppressed: 0 bytes in 0 blocks.
-Reachable blocks (those to which a pointer was found) are not shown.
-To see them, rerun with: --show-reachable=yes
-