Factorize producing the 'For counts of detected and suppressed errors' msg

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.
This commit is contained in:
Philippe Waroquiers 2018-12-23 20:35:09 +01:00
parent 39f0abfc92
commit 36bf7c0647
13 changed files with 19 additions and 35 deletions

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

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

View 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",

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

View 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,

View 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:

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

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

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

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

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

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

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