|
From: <sv...@va...> - 2011-10-13 16:47:34
|
Author: bart
Date: 2011-10-13 17:42:49 +0100 (Thu, 13 Oct 2011)
New Revision: 12144
Log:
drd, XML: make the XML output a little easier to parse
Modified:
trunk/drd/drd_error.c
trunk/drd/tests/annotate_barrier_xml.stderr.exp
trunk/drd/tests/annotate_trace_memory_xml.stderr.exp
Modified: trunk/drd/drd_error.c
===================================================================
--- trunk/drd/drd_error.c 2011-10-13 16:41:17 UTC (rev 12143)
+++ trunk/drd/drd_error.c 2011-10-13 16:42:49 UTC (rev 12144)
@@ -138,6 +138,8 @@
const Bool xml = VG_(clo_xml);
const char* const what_prefix = xml ? " <what>" : "";
const char* const what_suffix = xml ? "</what>" : "";
+ const char* const auxwhat_prefix = xml ? " <auxwhat>" : "";
+ const char* const auxwhat_suffix = xml ? "</auxwhat>" : "";
const char* const indent = xml ? " " : "";
AddrInfo ai;
@@ -190,39 +192,30 @@
if (descr2 != NULL)
print_err_detail("%s%s\n", indent, (HChar*)VG_(indexXA)(descr2, 0));
} else if (ai.akind == eMallocd && ai.lastchange) {
+ print_err_detail("%sAddress 0x%lx is at offset %ld from 0x%lx.%s%s",
+ auxwhat_prefix, dri->addr, ai.rwoffset,
+ dri->addr - ai.rwoffset, auxwhat_suffix,
+ xml ? "\n" : "");
if (xml)
- print_err_detail(" <auxwhat>\n <text>");
- print_err_detail("Address 0x%lx is at offset %ld from 0x%lx.",
- dri->addr, ai.rwoffset, dri->addr - ai.rwoffset);
- if (xml)
- print_err_detail("</text>\n");
+ print_err_detail(" <allocation_context>\n");
else
print_err_detail(" Allocation context:\n");
VG_(pp_ExeContext)(ai.lastchange);
if (xml)
- print_err_detail(" </auxwhat>\n");
+ print_err_detail(" </allocation_context>\n");
} else {
char sect_name[64];
VgSectKind sect_kind;
sect_kind = VG_(DebugInfo_sect_kind)(sect_name, sizeof(sect_name),
dri->addr);
- if (xml) {
- print_err_detail(" <auxwhat><text>");
- if (sect_kind != Vg_SectUnknown) {
- print_err_detail(" Allocation context: %pS section of %pS\n",
- VG_(pp_SectKind)(sect_kind), sect_name);
- } else {
- print_err_detail(" Allocation context: unknown.\n");
- }
- print_err_detail(" </text></auxwhat>\n");
+ if (sect_kind != Vg_SectUnknown) {
+ print_err_detail("%sAllocation context: %ps section of %ps%s\n",
+ auxwhat_prefix, VG_(pp_SectKind)(sect_kind),
+ sect_name, auxwhat_suffix);
} else {
- if (sect_kind != Vg_SectUnknown) {
- print_err_detail("Allocation context: %s section of %s\n",
- VG_(pp_SectKind)(sect_kind), sect_name);
- } else {
- print_err_detail("Allocation context: unknown.\n");
- }
+ print_err_detail("%sAllocation context: unknown.%s\n",
+ auxwhat_prefix, auxwhat_suffix);
}
}
if (s_show_conflicting_segments)
Modified: trunk/drd/tests/annotate_barrier_xml.stderr.exp
===================================================================
--- trunk/drd/tests/annotate_barrier_xml.stderr.exp 2011-10-13 16:41:17 UTC (rev 12143)
+++ trunk/drd/tests/annotate_barrier_xml.stderr.exp 2011-10-13 16:42:49 UTC (rev 12144)
@@ -194,8 +194,8 @@
<line>...</line>
</frame>
</stack>
- <auxwhat>
- <text>Address 0x........ is at offset 0 from 0x.........</text>
+ <auxwhat>Address 0x........ is at offset 0 from 0x.........</auxwhat>
+ <allocation_context>
<stack>
<frame>
<ip>0x........</ip>
@@ -222,7 +222,7 @@
<line>...</line>
</frame>
</stack>
- </auxwhat>
+ </allocation_context>
</error>
<error>
Modified: trunk/drd/tests/annotate_trace_memory_xml.stderr.exp
===================================================================
--- trunk/drd/tests/annotate_trace_memory_xml.stderr.exp 2011-10-13 16:41:17 UTC (rev 12143)
+++ trunk/drd/tests/annotate_trace_memory_xml.stderr.exp 2011-10-13 16:42:49 UTC (rev 12144)
@@ -96,8 +96,7 @@
<line>...</line>
</frame>
</stack>
- <auxwhat><text> Allocation context: BSS section of tsan_unittest
- </text></auxwhat>
+ <auxwhat>Allocation context: BSS section of tsan_unittest</auxwhat>
</error>
<traceline>
|