descriptors. Printing the context where the file descriptor was
originally opened and where it was previously closed.
+* The option --show-error-list=no|yes now accepts a new value all.
+ This indicates to also print the suppressed errors.
+ This is useful to analyse which errors are suppressed by which
+ suppression entries.
+ The valgrind monitor command 'v.info all_errors' similarly now
+ accepts a new optional argument 'also_suppressed' to show
+ all errors including the suppressed errors.
+
* ================== PLATFORM CHANGES =================
* ==================== TOOL CHANGES ===================
return any_supp;
}
-/* Show all the errors that occurred, and possibly also the
- suppressions used. */
-void VG_(show_all_errors) ( Int verbosity, Bool xml )
+/* See pub_core_errormgr.h. */
+void VG_(show_all_errors) ( Int verbosity, Bool xml, Int show_error_list)
{
- Int i, n_min;
+ Int i, n_min, n_errs;
Error *p, *p_min;
Bool any_supp;
Bool any_error = False;
- if (verbosity == 0 && !VG_(clo_show_error_list))
+ if (verbosity == 0 && show_error_list == 0)
return;
/* If we're printing XML, just show the suppressions and stop. */
if (xml) {
- if (VG_(clo_show_error_list))
+ if (show_error_list > 0)
(void)show_used_suppressions();
return;
}
n_errs_found, n_err_contexts,
n_errs_suppressed, n_supp_contexts );
- if (!VG_(clo_show_error_list))
+ if (show_error_list == 0)
return;
- // We do the following if VG_(clo_show_error_list)
+ // We do the following if show_error_list > 0
// or at -v or above, and only in non-XML mode.
/* Print the contexts in order of increasing error count.
+ The below implements this in a quadratic algorithm based on the assumption
+ that there are not too many errors (including the suppressed if showing
+ the suppressed errors) !
Once an error is shown, we add a huge value to its count to filter it
out.
After having shown all errors, we reset count to the original value. */
- for (i = 0; i < n_err_contexts; i++) {
+ n_errs = n_err_contexts + (show_error_list < 2 ? 0 : n_errs_suppressed);
+ for (i = 0; i < n_errs; i++) {
n_min = (1 << 30) - 1;
p_min = NULL;
for (p = errors; p != NULL; p = p->next) {
- if (p->supp != NULL) continue;
+ if (show_error_list < 2 && p->supp != NULL) continue;
if (p->count < n_min) {
n_min = p->count;
p_min = p;
any_error = True;
VG_(umsg)("\n");
- VG_(umsg)("%d errors in context %d of %u:\n",
- p_min->count, i+1, n_err_contexts);
+ VG_(umsg)("%d errors%s%s%s in context %d of %u:\n",
+ p_min->count,
+ p_min->supp == NULL ? "" : " (suppressed by ",
+ p_min->supp == NULL ? "" : p_min->supp->sname,
+ p_min->supp == NULL ? "" : ")",
+ i+1, n_errs);
pp_Error( p_min, False/*allow_db_attach*/, False /* xml */, True /* count_error */ );
// We're not printing XML -- we'd have exited above if so.
"general valgrind monitor commands:\n"
" help [debug] : monitor command help. With debug: + debugging commands\n"
" v.wait [<ms>] : sleep <ms> (default 0) then continue\n"
-" v.info all_errors : show all errors found so far\n"
+" v.info all_errors [also_suppressed] : show all errors found so far\n"
" v.info last_error : show last error found\n"
" v.info location <addr> : show information about location <addr>\n"
" v.info n_errs_found [msg] : show the nr of errors found so far and the given msg\n"
case -1:
break;
case 0: // all_errors
+ {
+ Int show_error_list = 1;
+ wcmd = strtok_r (NULL, " ", &ssaveptr);
+ if (wcmd != NULL) {
+ switch (VG_(keyword_id) ("also_suppressed", wcmd, kwd_report_all)) {
+ case -2:
+ case -1: break;
+ case 0:
+ show_error_list = 2;
+ break;
+ default: vg_assert (0);
+ }
+ }
// A verbosity of minimum 2 is needed to show the errors.
- VG_(show_all_errors)(/* verbosity */ 2, /* xml */ False);
- break;
+ VG_(show_all_errors)(/* verbosity */ 2, /* xml */ False, show_error_list);
+ }
+ break;
case 1: // n_errs_found
VG_(printf) ("n_errs_found %u n_errs_shown %u (vgdb-error %d) %s\n",
VG_(get_n_errs_found) (),
ARG are optional arguments, depending on the WHAT subcommand.
"""
-@Vinit("valgrind", "v.info all_errors", gdb.COMMAND_STATUS, gdb.COMPLETE_NONE, False)
+@Vinit("valgrind", "v.info all_errors", gdb.COMMAND_STATUS, gdb.COMPLETE_NONE, True)
class Valgrind_Info_All_Errors_Command(Valgrind_Command):
"""Show all errors found so far by Valgrind.
Usage: valgrind v.info all_errors
"""
+@Vinit("valgrind", "v.info all_errors also_suppressed", gdb.COMMAND_STATUS, gdb.COMPLETE_NONE, False)
+class Valgrind_Info_All_Errors_Also_Suppressed_Command(Valgrind_Command):
+ """Show all errors found so far by Valgrind, including the suppressed errors.
+Usage: valgrind v.info all_errors also_suppressed
+"""
+
@Vinit("valgrind", "v.info last_error", gdb.COMMAND_STATUS, gdb.COMPLETE_NONE, False)
class Valgrind_Info_Last_Error_Command(Valgrind_Command):
"""Show last error found by Valgrind.
" --error-exitcode=<number> exit code to return if errors found [0=disable]\n"
" --error-markers=<begin>,<end> add lines with begin/end markers before/after\n"
" each error output in plain text mode [none]\n"
-" --show-error-list=no|yes show detected errors list and\n"
-" suppression counts at exit [no]\n"
+" --show-error-list=no|yes|all show detected errors list and\n"
+" suppression counts at exit [no].\n"
+" all means to also print suppressed errors.\n"
" -s same as --show-error-list=yes\n"
" --keep-debuginfo=no|yes Keep symbols etc for unloaded code [no]\n"
" This allows saved stack traces (e.g. memory leaks)\n"
startpos = *nextpos ? nextpos + 1 : nextpos;
}
}
- else if VG_BOOL_CLOM(cloPD, arg, "--show-error-list", VG_(clo_show_error_list)) {
+ else if VG_STR_CLOM(cloPD, arg, "--show-error-list", tmp_str) {
+ if (VG_(strcmp)(tmp_str, "yes") == 0)
+ VG_(clo_show_error_list) = 1;
+ else if (VG_(strcmp)(tmp_str, "all") == 0)
+ VG_(clo_show_error_list) = 2;
+ else if (VG_(strcmp)(tmp_str, "no") == 0)
+ VG_(clo_show_error_list) = 0;
+ else
+ VG_(fmsg_bad_option)(arg,
+ "Bad argument, should be 'yes', 'all' or 'no'\n");
pos->show_error_list_set = True; }
else if (VG_STREQ_CLOM(cloPD, arg, "-s")) {
- VG_(clo_show_error_list) = True;
+ VG_(clo_show_error_list) = 1;
pos->show_error_list_set = True;
}
else if VG_BOOL_CLO(arg, "--show-emwarns", VG_(clo_show_emwarns)) {}
else if VG_BOOL_CLOM(cloPD, arg, "--trace-children", VG_(clo_trace_children)) {}
else if VG_BOOL_CLOM(cloPD, arg, "--child-silent-after-fork",
VG_(clo_child_silent_after_fork)) {}
-else if VG_INT_CLOM(cloPD, arg, "--scheduling-quantum",
- VG_(clo_scheduling_quantum)) {}
+ else if VG_INT_CLOM(cloPD, arg, "--scheduling-quantum",
+ VG_(clo_scheduling_quantum)) {}
else if VG_STR_CLO(arg, "--fair-sched", tmp_str) {
if (VG_(Clo_Mode)() != cloP)
;
}
/* In XML mode, this merely prints the used suppressions. */
- VG_(show_all_errors)(VG_(clo_verbosity), VG_(clo_xml));
+ VG_(show_all_errors)(VG_(clo_verbosity), VG_(clo_xml), VG_(clo_show_error_list));
}
if (VG_(clo_xml)) {
HChar *VG_(clo_error_markers)[2] = {NULL, NULL};
Bool VG_(clo_exit_on_first_error) = False;
-Bool VG_(clo_show_error_list) = False;
+Int VG_(clo_show_error_list) = 0;
#if defined(VGPV_arm_linux_android) \
|| defined(VGPV_x86_linux_android) \
extern void VG_(load_suppressions) ( void );
-// if verbosity == 0, print nothing.
-// else if xml print suppressions used (in xml format)
-// else if verbosity == 1 print Error summary
-// else print all errors and suppressions used.
-extern void VG_(show_all_errors) ( Int verbosity, Bool xml );
+// if verbosity == 0 && show_error_list == no (0)
+// print nothing.
+// else if xml
+// if show_error_list == yes (1)|all(2)
+// print suppressions used (in xml format)
+// else
+// print Error summary
+// if show_error_list == yes|all
+// print all errors and suppressions used.
+// if show_error_list == all or also_suppressed,
+// also print the suppressed errors.
+extern void VG_(show_all_errors) ( Int verbosity,
+ Bool xml,
+ Int show_error_list);
/* Print (in readable format) the last error that occurred. */
extern void VG_(show_last_error) ( void );
/* For tools that report errors, list detected errors and show suppression
usage counts at exit. Default: No.
Unless set explicitly by the user, the option is automatically
- considered as set to yes for verbosity > 1. */
-extern Bool VG_(clo_show_error_list);
+ considered as set to yes for verbosity > 1.
+ Note that in xml mode, errors are automatically printed as part of
+ the xml output. This option then only controls printing the used suppressions.
+ default: 0 (NO)
+ 1 (yes)
+ 2 (all meaning also print suppressed errors). */
+extern Int VG_(clo_show_error_list);
/* Markers used to mark the begin/end of an error, when errors are
</listitem>
<listitem>
- <para><varname>v.info all_errors</varname> shows all errors found
- so far.</para>
+ <para><varname>v.info all_errors [also_suppressed]</varname> shows all errors found
+ so far.</para>
+ <para> The optional "also_suppressed" argument indicates to also output
+ the suppressed errors.</para>
</listitem>
<listitem>
<para><varname>v.info last_error</varname> shows the last error
<varlistentry id="opt.show-error-list" xreflabel="--show-error-list">
<term>
- <option><![CDATA[--show-error-list=no|yes [default: no]]]></option>
+ <option><![CDATA[--show-error-list=no|yes|all [default: no]]]></option>
</term>
<listitem>
- <para>If this option is enabled, for tools that report errors, valgrind
+ <para>If this option is yes, for tools that report errors, valgrind
will show the list of detected errors and the list of used suppressions
- at exit.
+ at exit. The value all indicates to also show the list of suppressed
+ errors.
</para>
<para>Note that at verbosity 2 and above, valgrind automatically shows
the list of detected errors and the list of used suppressions
general valgrind monitor commands:
help [debug] : monitor command help. With debug: + debugging commands
v.wait [<ms>] : sleep <ms> (default 0) then continue
- v.info all_errors : show all errors found so far
+ v.info all_errors [also_suppressed] : show all errors found so far
v.info last_error : show last error found
v.info location <addr> : show information about location <addr>
v.info n_errs_found [msg] : show the nr of errors found so far and the given msg
general valgrind monitor commands:
help [debug] : monitor command help. With debug: + debugging commands
v.wait [<ms>] : sleep <ms> (default 0) then continue
- v.info all_errors : show all errors found so far
+ v.info all_errors [also_suppressed] : show all errors found so far
v.info last_error : show last error found
v.info location <addr> : show information about location <addr>
v.info n_errs_found [msg] : show the nr of errors found so far and the given msg
general valgrind monitor commands:
help [debug] : monitor command help. With debug: + debugging commands
v.wait [<ms>] : sleep <ms> (default 0) then continue
- v.info all_errors : show all errors found so far
+ v.info all_errors [also_suppressed] : show all errors found so far
v.info last_error : show last error found
v.info location <addr> : show information about location <addr>
v.info n_errs_found [msg] : show the nr of errors found so far and the given msg
--error-exitcode=<number> exit code to return if errors found [0=disable]
--error-markers=<begin>,<end> add lines with begin/end markers before/after
each error output in plain text mode [none]
- --show-error-list=no|yes show detected errors list and
- suppression counts at exit [no]
+ --show-error-list=no|yes|all show detected errors list and
+ suppression counts at exit [no].
+ all means to also print suppressed errors.
-s same as --show-error-list=yes
--keep-debuginfo=no|yes Keep symbols etc for unloaded code [no]
This allows saved stack traces (e.g. memory leaks)
--error-exitcode=<number> exit code to return if errors found [0=disable]
--error-markers=<begin>,<end> add lines with begin/end markers before/after
each error output in plain text mode [none]
- --show-error-list=no|yes show detected errors list and
- suppression counts at exit [no]
+ --show-error-list=no|yes|all show detected errors list and
+ suppression counts at exit [no].
+ all means to also print suppressed errors.
-s same as --show-error-list=yes
--keep-debuginfo=no|yes Keep symbols etc for unloaded code [no]
This allows saved stack traces (e.g. memory leaks)
fi
done
- # check that filter files (but nor ones derived from filter*.in) are in dist_noinst_SCRIPTS
- for f in $(ls -d filter* 2>/dev/null | grep -v \.in)
+ # check that filter files (but nor ones derived from filter*.in and emacs backup files)
+ # are in dist_noinst_SCRIPTS
+ for f in $(ls -d filter* 2>/dev/null | grep -v -e \.in -e '.*~$')
do
if [ ! -e "$f".in ]; then
if ! echo "${parsed_makefile}" 2>/dev/null | grep '^ *dist_noinst_SCRIPTS *=' |