]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Factorize producing the 'For counts of detected and suppressed errors' msg
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sun, 23 Dec 2018 19:35:09 +0000 (20:35 +0100)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sun, 23 Dec 2018 22:45:33 +0000 (23:45 +0100)
Each tool producing errors had identical code to produce this msg.
Factorize the production of the message in m_main.c

This prepares the work to have a specific option to show the list
of detected errors and the count of suppressed errors.

This has a (small) visible effect on the output of memcheck:
Instead of producing
  For counts of detected and suppressed errors, rerun with: -v
  Use --track-origins=yes to see where uninitialised values come from
memcheck now produces:
  Use --track-origins=yes to see where uninitialised values come from
  For counts of detected and suppressed errors, rerun with: -v

i.e. the track origin and counts of errors msg are inverted.

13 files changed:
coregrind/m_main.c
drd/drd_main.c
exp-sgcheck/h_main.c
helgrind/hg_main.c
memcheck/mc_main.c
memcheck/tests/addressable.stderr.exp
memcheck/tests/amd64/sh-mem-vec256-plo-no.stderr.exp
memcheck/tests/amd64/sh-mem-vec256-plo-yes.stderr.exp
memcheck/tests/common/sh-mem-vec128-plo-no.stderr.exp-32bit-le
memcheck/tests/common/sh-mem-vec128-plo-no.stderr.exp-64bit-le
memcheck/tests/common/sh-mem-vec128-plo-yes.stderr.exp-32bit-le
memcheck/tests/common/sh-mem-vec128-plo-yes.stderr.exp-64bit-le
memcheck/tests/partiallydefinedeq.stderr.exp

index 93998cfaa3150c3af78f01eaa1f29c381e14f01e..cb4268569dd2df58c120ee4d7423bacab15b5796 100644 (file)
@@ -2152,15 +2152,19 @@ void shutdown_actions_NORETURN( ThreadId tid,
       the error management machinery. */
    VG_TDICT_CALL(tool_fini, 0/*exitcode*/);
 
-   /* Show the error counts. */
-   if (VG_(clo_xml)
-       && (VG_(needs).core_errors || VG_(needs).tool_errors)) {
-      VG_(show_error_counts_as_XML)();
-   }
+   if (VG_(needs).core_errors || VG_(needs).tool_errors) {
+      if (VG_(clo_verbosity) == 1 && !VG_(clo_xml))
+         VG_(message)(Vg_UserMsg, 
+                      "For counts of detected and suppressed errors, rerun with: -v\n");
 
-   /* In XML mode, this merely prints the used suppressions. */
-   if (VG_(needs).core_errors || VG_(needs).tool_errors)
+      /* Show the error counts. */
+      if (VG_(clo_xml)) {
+         VG_(show_error_counts_as_XML)();
+      }
+
+      /* In XML mode, this merely prints the used suppressions. */
       VG_(show_all_errors)(VG_(clo_verbosity), VG_(clo_xml));
+   }
 
    if (VG_(clo_xml)) {
       VG_(printf_xml)("\n");
index 79bdce2aecb1a68fe542211d60b0ce7045a88d18..3df967ef2875abcb411fae56085589c08429f2d2 100644 (file)
@@ -761,10 +761,6 @@ static void drd_start_client_code(const ThreadId tid, const ULong bbs_done)
 static void DRD_(fini)(Int exitcode)
 {
    // thread_print_all();
-   if (VG_(clo_verbosity) == 1 && !VG_(clo_xml)) {
-      VG_(message)(Vg_UserMsg, "For counts of detected and suppressed errors, "
-                   "rerun with: -v\n");
-   }
 
    if ((VG_(clo_stats) || s_print_stats) && !VG_(clo_xml))
    {
index 073e66a5897b1b452cd519854185337a757c314b..1baf1cd13bb71be7cec34edc940e17a60dc10c23 100644 (file)
@@ -708,12 +708,6 @@ IRSB* h_instrument ( VgCallbackClosure* closure,
 
 void h_fini ( Int exitcode )
 {
-   if (VG_(clo_verbosity) == 1 && !VG_(clo_xml)) {
-      VG_(message)(Vg_UserMsg, 
-                   "For counts of detected and suppressed errors, "
-                   "rerun with: -v\n");
-   }
-
    if (VG_(clo_stats)) {
       VG_(message)(Vg_DebugMsg,
                    "  h_:  %'10llu client allocs, %'10llu client frees\n", 
index 0a3beea7d0e2e8f3efd4a9aea80ed40b6a25c4ec..d75aa43d82ac66f4ea87243dbdd514b287aea6f4 100644 (file)
@@ -5897,11 +5897,6 @@ static void hg_print_stats (void)
 static void hg_fini ( Int exitcode )
 {
    HG_(xtmemory_report) (VG_(clo_xtree_memory_file), True);
-   if (VG_(clo_verbosity) == 1 && !VG_(clo_xml)) {
-      VG_(message)(Vg_UserMsg, 
-                   "For counts of detected and suppressed errors, "
-                   "rerun with: -v\n");
-   }
 
    if (VG_(clo_verbosity) == 1 && !VG_(clo_xml)
        && HG_(clo_history_level) >= 2) {
index 101916b5a3b69a3f5168c339ee46814587441770..253f091dc312c187ece6787fc7107e491b3c787b 100644 (file)
@@ -8019,11 +8019,6 @@ static void mc_fini ( Int exitcode )
       }
    }
 
-   if (VG_(clo_verbosity) == 1 && !VG_(clo_xml)) {
-      VG_(message)(Vg_UserMsg, 
-                   "For counts of detected and suppressed errors, rerun with: -v\n");
-   }
-
    if (MC_(any_value_errors) && !VG_(clo_xml) && VG_(clo_verbosity) >= 1
        && MC_(clo_mc_level) == 2) {
       VG_(message)(Vg_UserMsg,
index 8fbd9528f32c763ccecb6d7e80031b06dcb15c91..b3441cd40426b0a9000d7104e68102bd6bbc02fc 100644 (file)
@@ -77,8 +77,8 @@ HEAP SUMMARY:
 
 For a detailed leak analysis, rerun with: --leak-check=full
 
-For counts of detected and suppressed errors, rerun with: -v
 Use --track-origins=yes to see where uninitialised values come from
+For counts of detected and suppressed errors, rerun with: -v
 ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
 
 HEAP SUMMARY:
index e4d60a559415ca8849f2c85ab9dcae2c0f8a645b..f637e6d0d3dcb35b70db205be070f47707b4d89f 100644 (file)
@@ -937,6 +937,6 @@ HEAP SUMMARY:
 
 For a detailed leak analysis, rerun with: --leak-check=full
 
-For counts of detected and suppressed errors, rerun with: -v
 Use --track-origins=yes to see where uninitialised values come from
+For counts of detected and suppressed errors, rerun with: -v
 ERROR SUMMARY: 130 errors from 100 contexts (suppressed: 0 from 0)
index 366bcc0a764d634263e0f8cb43fb76c712821978..e2b863b5bf930295feab667a46e4379e94c10267 100644 (file)
@@ -863,6 +863,6 @@ HEAP SUMMARY:
 
 For a detailed leak analysis, rerun with: --leak-check=full
 
-For counts of detected and suppressed errors, rerun with: -v
 Use --track-origins=yes to see where uninitialised values come from
+For counts of detected and suppressed errors, rerun with: -v
 ERROR SUMMARY: 99 errors from 99 contexts (suppressed: 0 from 0)
index 1cf415d5016c68aaff1181050aae65ff7100b68b..19e1b22ebce699ff8160104128146cab60eccaee 100644 (file)
@@ -572,6 +572,6 @@ HEAP SUMMARY:
 
 For a detailed leak analysis, rerun with: --leak-check=full
 
-For counts of detected and suppressed errors, rerun with: -v
 Use --track-origins=yes to see where uninitialised values come from
+For counts of detected and suppressed errors, rerun with: -v
 ERROR SUMMARY: 66 errors from 66 contexts (suppressed: 0 from 0)
index c81db9b3779caa9822e38176325a7ba5ae6a739b..d16bfe0a0da8903deff8d9dcc1af9bbbd0287e12 100644 (file)
@@ -572,6 +572,6 @@ HEAP SUMMARY:
 
 For a detailed leak analysis, rerun with: --leak-check=full
 
-For counts of detected and suppressed errors, rerun with: -v
 Use --track-origins=yes to see where uninitialised values come from
+For counts of detected and suppressed errors, rerun with: -v
 ERROR SUMMARY: 66 errors from 66 contexts (suppressed: 0 from 0)
index 099af000552f591ed69440d4877703319711b46b..34d597a085eec4c808e83bfb6580ecec8a7db3f2 100644 (file)
@@ -463,6 +463,6 @@ HEAP SUMMARY:
 
 For a detailed leak analysis, rerun with: --leak-check=full
 
-For counts of detected and suppressed errors, rerun with: -v
 Use --track-origins=yes to see where uninitialised values come from
+For counts of detected and suppressed errors, rerun with: -v
 ERROR SUMMARY: 51 errors from 51 contexts (suppressed: 0 from 0)
index e95bebc234fcf0edcf5b2f52c6ec1156a3e0680c..362324595113a6453a287c42120bfd37b7589f35 100644 (file)
@@ -463,6 +463,6 @@ HEAP SUMMARY:
 
 For a detailed leak analysis, rerun with: --leak-check=full
 
-For counts of detected and suppressed errors, rerun with: -v
 Use --track-origins=yes to see where uninitialised values come from
+For counts of detected and suppressed errors, rerun with: -v
 ERROR SUMMARY: 51 errors from 51 contexts (suppressed: 0 from 0)
index 9f38011acadb2ce67de6bf0374f3bbccfc70a081..c6d1f0b553c10f0ba228ae772ee289ee90d5c760 100644 (file)
@@ -14,6 +14,6 @@ HEAP SUMMARY:
 
 For a detailed leak analysis, rerun with: --leak-check=full
 
-For counts of detected and suppressed errors, rerun with: -v
 Use --track-origins=yes to see where uninitialised values come from
+For counts of detected and suppressed errors, rerun with: -v
 ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)