* ==================== OTHER CHANGES ====================
+* Option --error-markers=<begin>,<end> can be used to mark
+ the begin/end of errors in textual output mode, to facilitate
+ searching/extracting errors in output files mixing valgrind
+ errors with program output.
+
* ==================== FIXED BUGS ====================
The following bugs have been fixed or resolved. Note that "n-i-bz"
} else {
+ if (VG_(clo_error_markers)[0])
+ VG_(umsg)("%s\n", VG_(clo_error_markers)[0]);
VG_TDICT_CALL( tool_before_pp_Error, err );
if (VG_(tdict).tool_show_ThreadIDs_for_errors
VG_TDICT_CALL( tool_pp_Error, err );
VG_(umsg)("\n");
+ if (VG_(clo_error_markers)[1])
+ VG_(umsg)("%s\n", VG_(clo_error_markers)[1]);
do_actions_on_error(err, allow_db_attach);
}
" --num-callers=<number> show <number> callers in stack traces [12]\n"
" --error-limit=no|yes stop showing new errors if too many? [yes]\n"
" --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-below-main=no|yes continue stack traces below main() [no]\n"
" --default-suppressions=yes|no\n"
" load default suppressions [yes]\n"
else if VG_STR_CLO (arg, "--soname-synonyms",VG_(clo_soname_synonyms)) {}
else if VG_BOOL_CLO(arg, "--error-limit", VG_(clo_error_limit)) {}
else if VG_INT_CLO (arg, "--error-exitcode", VG_(clo_error_exitcode)) {}
+ else if VG_STR_CLO (arg, "--error-markers", tmp_str) {
+ Int m;
+ const HChar *startpos = tmp_str;
+ const HChar *nextpos;
+ for (m = 0;
+ m < sizeof(VG_(clo_error_markers))
+ /sizeof(VG_(clo_error_markers)[0]);
+ m++) {
+ /* Release previous value if clo given multiple times. */
+ VG_(free)(VG_(clo_error_markers)[m]);
+ VG_(clo_error_markers)[m] = NULL;
+
+ nextpos = VG_(strchr)(startpos, ',');
+ if (!nextpos)
+ nextpos = startpos + VG_(strlen)(startpos);
+ if (startpos != nextpos) {
+ VG_(clo_error_markers)[m]
+ = VG_(malloc)("", nextpos - startpos + 1);
+ VG_(memcpy)(VG_(clo_error_markers)[m], startpos,
+ nextpos - startpos);
+ VG_(clo_error_markers)[m][nextpos - startpos] = '\0';
+ }
+ startpos = *nextpos ? nextpos + 1 : nextpos;
+ }
+ }
else if VG_BOOL_CLO(arg, "--show-emwarns", VG_(clo_show_emwarns)) {}
else if VG_BOOL_CLO(arg, "--run-libc-freeres", VG_(clo_run_libc_freeres)) {}
VexControl VG_(clo_vex_control);
Bool VG_(clo_error_limit) = True;
Int VG_(clo_error_exitcode) = 0;
+HChar *VG_(clo_error_markers)[2] = {NULL, NULL};
#if defined(VGPV_arm_linux_android) \
|| defined(VGPV_x86_linux_android) \
way. */
extern Int VG_(clo_error_exitcode);
+/* Markers used to mark the begin/end of an error, when errors are
+ printed in textual (non xml) format.
+ [0] is the error begin marker, [1] is the error end marker.
+ default: no markers. */
+extern HChar *VG_(clo_error_markers)[2];
+
typedef
enum {
Vg_VgdbNo, // Do not activate gdbserver.
</listitem>
</varlistentry>
+ <varlistentry id="opt.error-markers" xreflabel="--error-markers">
+ <term>
+ <option><![CDATA[--error-markers=<begin>,<end> [default: none]]]></option>
+ </term>
+ <listitem>
+ <para>When errors are output as plain text (i.e. XML not used),
+ <option>--error-markers</option> instructs to output a line
+ containing the <option>begin</option> (<option>end</option>)
+ string before (after) each error. </para>
+ <para> Such marker lines facilitate searching for errors and/or
+ extracting errors in an output file that contain valgrind errors mixed
+ with the program output. </para>
+ <para> Note that empty markers are accepted. So, only using a begin
+ (or an end) marker is possible.</para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="opt.sigill-diagnostics" xreflabel="--sigill-diagnostics">
<term>
<option><![CDATA[--sigill-diagnostics=<yes|no> [default: yes] ]]></option>
+[[[
Invalid write of size 1
at 0x........: main (badaddrvalue.c:8)
Address 0x........ is 1 bytes before a block of size 8 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (badaddrvalue.c:7)
+]]]
+[[[
Invalid read of size 1
at 0x........: main (badaddrvalue.c:9)
Address 0x........ is 1 bytes before a block of size 8 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (badaddrvalue.c:7)
+]]]
prog: badaddrvalue
-vgopts: -q
+vgopts: -q --error-markers=[[[,]]]
+[[[
Conditional jump or move depends on uninitialised value(s)
at 0x........: main (manuel1.c:7)
prog: manuel1
-vgopts: -q
+vgopts: -q --error-markers=[[[
Use of uninitialised value of size 4
at 0x........: main (manuel2.c:10)
+]]]
Use of uninitialised value of size 8
at 0x........: main (manuel2.c:10)
+]]]
prog: manuel2
-vgopts: -q
+vgopts: -q --error-markers=,]]]
prog: manuel3
-vgopts: -q
+vgopts: -q --error-markers=,
--num-callers=<number> show <number> callers in stack traces [12]
--error-limit=no|yes stop showing new errors if too many? [yes]
--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-below-main=no|yes continue stack traces below main() [no]
--default-suppressions=yes|no
load default suppressions [yes]
--num-callers=<number> show <number> callers in stack traces [12]
--error-limit=no|yes stop showing new errors if too many? [yes]
--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-below-main=no|yes continue stack traces below main() [no]
--default-suppressions=yes|no
load default suppressions [yes]