|
From: <sv...@va...> - 2008-04-25 15:24:54
|
Author: sewardj
Date: 2008-04-25 16:24:43 +0100 (Fri, 25 Apr 2008)
New Revision: 7916
Log:
Attempt to support origins in Memcheck's XML output. May require
refinement, however this is at least a start.
Modified:
branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_main.c
branches/OTRACK_BY_INSTRUMENTATION/docs/internals/xml-output.txt
branches/OTRACK_BY_INSTRUMENTATION/memcheck/mc_main.c
Modified: branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_main.c
===================================================================
--- branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_main.c 2008-04-25 11:33:30 UTC (rev 7915)
+++ branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_main.c 2008-04-25 15:24:43 UTC (rev 7916)
@@ -743,7 +743,7 @@
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "<valgrindoutput>");
VG_(message)(Vg_UserMsg, "");
- VG_(message)(Vg_UserMsg, "<protocolversion>2</protocolversion>");
+ VG_(message)(Vg_UserMsg, "<protocolversion>3</protocolversion>");
VG_(message)(Vg_UserMsg, "");
}
Modified: branches/OTRACK_BY_INSTRUMENTATION/docs/internals/xml-output.txt
===================================================================
--- branches/OTRACK_BY_INSTRUMENTATION/docs/internals/xml-output.txt 2008-04-25 11:33:30 UTC (rev 7915)
+++ branches/OTRACK_BY_INSTRUMENTATION/docs/internals/xml-output.txt 2008-04-25 15:24:43 UTC (rev 7916)
@@ -107,12 +107,13 @@
</valgrindoutput>
Valgrind versions 3.0.0 and 3.0.1 emit protocol version 1. Versions
-3.1.X and 3.2.X emit protocol version 2.
+3.1.X and 3.2.X emit protocol version 2. 3.4.X emits protocol version
+3.
PROTOCOL for version 3
----------------------
-Changes in 3.3.X (tentative): (jrs, 1 March 2008)
+Changes in 3.4.X (tentative): (jrs, 1 March 2008)
* There may be more than one <logfilequalifier> clause, depending on
how this pans out. (AshleyP perhaps to investigate)
@@ -120,7 +121,11 @@
* Some errors may have two <auxwhat> blocks, rather than just one
(resulting from merge of the DATASYMS branch)
+* Some errors may have an ORIGIN component, indicating the origins of
+ uninitialised values. This results from the merge of the
+ OTRACK_BY_INSTRUMENTATION branch.
+
PROTOCOL for version 2
----------------------
Version 2 is identical in every way to version 1, except that the time
@@ -231,6 +236,7 @@
optionally: <auxwhat>TEXT</auxwhat>
optionally: STACK
+ optionally: ORIGIN
</error>
@@ -376,6 +382,19 @@
* line: gives the line number in the source file
+ORIGIN
+------
+ORIGIN shows the origin of uninitialised data in errors that involve
+uninitialised data. STACK shows the origin of the uninitialised
+value. TEXT gives a human-understandable hint as to the meaning of
+the information in STACK.
+
+ <origin>
+ <what>TEXT<what>
+ STACK
+ </origin>
+
+
ERRORCOUNTS
-----------
This specifies, for each error that has been so far presented,
Modified: branches/OTRACK_BY_INSTRUMENTATION/memcheck/mc_main.c
===================================================================
--- branches/OTRACK_BY_INSTRUMENTATION/memcheck/mc_main.c 2008-04-25 11:33:30 UTC (rev 7915)
+++ branches/OTRACK_BY_INSTRUMENTATION/memcheck/mc_main.c 2008-04-25 15:24:43 UTC (rev 7916)
@@ -3892,14 +3892,24 @@
static void mc_pp_origin ( ExeContext* ec, Bool is_stack_origin )
{
tl_assert(ec);
+ HChar* xpre = VG_(clo_xml) ? " <what>" : " ";
+ HChar* xpost = VG_(clo_xml) ? "</what>" : "";
+ if (VG_(clo_xml)) {
+ VG_(message)(Vg_UserMsg, " <origin>");
+ }
if (is_stack_origin) {
- VG_(message)(Vg_UserMsg, " Uninitialised value originates "
- "from a stack allocation");
+ VG_(message)(Vg_UserMsg, "%sUninitialised value originates "
+ "from a stack allocation%s",
+ xpre, xpost);
} else {
- VG_(message)(Vg_UserMsg, " Uninitialised value originates "
- "from a heap block allocated");
+ VG_(message)(Vg_UserMsg, "%sUninitialised value originates "
+ "from a heap block allocated%s",
+ xpre, xpost);
}
VG_(pp_ExeContext)( ec );
+ if (VG_(clo_xml)) {
+ VG_(message)(Vg_UserMsg, " </origin>");
+ }
}
static void mc_pp_Error ( Error* err )
|