From: Julian Seward Date: Wed, 6 Dec 2006 18:05:54 +0000 (+0000) Subject: Fix confusing and contradictory "Rerun with ..." messages printed at X-Git-Tag: svn/VALGRIND_3_3_0~503 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80a670f93c77a6fece29ead8221e28c5686b37ca;p=thirdparty%2Fvalgrind.git Fix confusing and contradictory "Rerun with ..." messages printed at the end of MC_(do_detect_memory_leaks). This causes various leak regression tests to fail; will fix shortly. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6382 --- diff --git a/memcheck/mc_leakcheck.c b/memcheck/mc_leakcheck.c index a0b607a35e..71256e9902 100644 --- a/memcheck/mc_leakcheck.c +++ b/memcheck/mc_leakcheck.c @@ -928,14 +928,17 @@ void MC_(do_detect_memory_leaks) ( MC_(bytes_reachable), blocks_reachable ); VG_(message)(Vg_UserMsg, " suppressed: %,lu bytes in %,lu blocks.", MC_(bytes_suppressed), blocks_suppressed ); - if (mode == LC_Summary && blocks_leaked > 0) - VG_(message)(Vg_UserMsg, - "Use --leak-check=full to see details of leaked memory."); - else if (!MC_(clo_show_reachable)) { + if (mode == LC_Summary + && (blocks_leaked + blocks_indirect + + blocks_dubious + blocks_reachable) > 0) { + VG_(message)(Vg_UserMsg, + "Rerun with --leak-check=full to see details of leaked memory."); + } + if (blocks_reachable > 0 && !MC_(clo_show_reachable) && mode == LC_Full) { 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"); + "To see them, rerun with: --leak-check=full --show-reachable=yes"); } }