Make --leak-check observe -q properly -- only prints out errors, not general

info and summaries.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2082
This commit is contained in:
Nicholas Nethercote 2003-12-02 10:17:44 +00:00
parent 3ddb89814c
commit fd5b4b7fa0
4 changed files with 23 additions and 52 deletions

View 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 );

View 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

View 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

View 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