|
From: <sv...@va...> - 2011-10-04 16:33:28
|
Author: bart
Date: 2011-10-04 17:28:42 +0100 (Tue, 04 Oct 2011)
New Revision: 12095
Log:
Helgrind and exp-sgcheck, XML error reporting: move the code printing <kind>...</kind> out of a switch statement.
Modified:
trunk/exp-sgcheck/pc_common.c
trunk/helgrind/hg_errors.c
Modified: trunk/exp-sgcheck/pc_common.c
===================================================================
--- trunk/exp-sgcheck/pc_common.c 2011-10-04 03:55:04 UTC (rev 12094)
+++ trunk/exp-sgcheck/pc_common.c 2011-10-04 16:28:42 UTC (rev 12095)
@@ -309,6 +309,9 @@
XError *xe = (XError*)VG_(get_error_extra)(err);
tl_assert(xe);
+ if (xml)
+ emit( " <kind>%s</kind>\n", pc_get_error_name(err));
+
switch (VG_(get_error_kind)(err)) {
//----------------------------------------------------------
@@ -316,7 +319,6 @@
if (xml) {
- emit( " <kind>SorG</kind>\n");
emit( " <what>Invalid %s of size %ld</what>\n",
xe->XE.SorG.sszB < 0 ? "write" : "read",
Word__abs(xe->XE.SorG.sszB) );
@@ -357,7 +359,6 @@
if (xml) {
- emit( " <kind>Heap</kind>\n");
emit( " <what>Invalid %s of size %ld</what>\n",
readwrite(xe->XE.Heap.sszB),
Word__abs(xe->XE.Heap.sszB) );
@@ -392,7 +393,6 @@
if (xml) {
- emit( " <kind>Heap</kind>\n");
emit( " <what>%s %s of size %ld</what>\n",
how_invalid,
readwrite(xe->XE.Heap.sszB),
@@ -475,7 +475,6 @@
if (xml) {
- emit( " <kind>Arith</kind>\n");
emit( " <what>Invalid arguments to %s</what>\n",
xe->XE.Arith.opname );
VG_(pp_ExeContext)( VG_(get_error_where)(err) );
@@ -561,7 +560,6 @@
if (xml) {
- emit( " <kind>SysParam</kind>\n");
emit( " <what>%s%s contains unaddressable byte(s)</what>\n",
what, s );
VG_(pp_ExeContext)( VG_(get_error_where)(err) );
@@ -589,7 +587,6 @@
if (xml) {
- emit( " <kind>SysParam</kind>\n");
emit( " <what>%s%s is non-contiguous</what>\n",
what, s );
VG_(pp_ExeContext)( VG_(get_error_where)(err) );
Modified: trunk/helgrind/hg_errors.c
===================================================================
--- trunk/helgrind/hg_errors.c 2011-10-04 03:55:04 UTC (rev 12094)
+++ trunk/helgrind/hg_errors.c 2011-10-04 16:28:42 UTC (rev 12095)
@@ -942,6 +942,9 @@
XError *xe = (XError*)VG_(get_error_extra)(err);
tl_assert(xe);
+ if (xml)
+ emit( " <kind>%s</kind>\n", HG_(get_error_name)(err));
+
switch (VG_(get_error_kind)(err)) {
case XE_Misc: {
@@ -949,7 +952,6 @@
if (xml) {
- emit( " <kind>Misc</kind>\n");
emit( " <xwhat>\n" );
emit( " <text>Thread #%d: %s</text>\n",
(Int)xe->XE.Misc.thr->errmsg_index,
@@ -985,7 +987,6 @@
if (xml) {
- emit( " <kind>LockOrder</kind>\n");
emit( " <xwhat>\n" );
emit( " <text>Thread #%d: lock order \"%p before %p\" "
"violated</text>\n",
@@ -1050,7 +1051,6 @@
if (xml) {
- emit( " <kind>PthAPIerror</kind>\n");
emit( " <xwhat>\n" );
emit_no_f_c(
" <text>Thread #%d's call to %t failed</text>\n",
@@ -1082,7 +1082,6 @@
if (xml) {
- emit( " <kind>UnlockBogus</kind>\n");
emit( " <xwhat>\n" );
emit( " <text>Thread #%d unlocked an invalid "
"lock at %p</text>\n",
@@ -1112,7 +1111,6 @@
if (xml) {
- emit( " <kind>UnlockForeign</kind>\n");
emit( " <xwhat>\n" );
emit( " <text>Thread #%d unlocked lock at %p "
"currently held by thread #%d</text>\n",
@@ -1157,7 +1155,6 @@
if (xml) {
- emit( " <kind>UnlockUnlocked</kind>\n");
emit( " <xwhat>\n" );
emit( " <text>Thread #%d unlocked a "
"not-locked lock at %p</text>\n",
@@ -1205,7 +1202,6 @@
if (xml) {
/* ------ XML ------ */
- emit( " <kind>Race</kind>\n" );
emit( " <xwhat>\n" );
emit( " <text>Possible data race during %s of size %d "
"at %p by thread #%d</text>\n",
|