Helgrind and exp-sgcheck, XML error reporting: move the code printing <kind>...</kind> out of a switch statement.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12095 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/helgrind/hg_errors.c b/helgrind/hg_errors.c
index 41d99e2..010f5e0 100644
--- a/helgrind/hg_errors.c
+++ b/helgrind/hg_errors.c
@@ -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",