]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix incorrect use of VG_(tool_panic). Adapt checker script accordingly.
authorFlorian Krohm <florian@eich-krohm.de>
Tue, 16 Sep 2014 09:28:12 +0000 (09:28 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Tue, 16 Sep 2014 09:28:12 +0000 (09:28 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14544

coregrind/m_addrinfo.c
coregrind/m_errormgr.c
coregrind/m_libcprint.c
coregrind/m_main.c
tests/check_headers_and_includes

index 21fd41358aef112107e7d45d0d6fc9593b600aca..05566fdcc3d1b5a4f5455fc1c0e2b69b223b0cf5 100644 (file)
@@ -550,7 +550,7 @@ static void pp_addrinfo_WRK ( Addr a, AddrInfo* ai, Bool mc, Bool maybe_gcc )
          break;
 
       default:
-         VG_(tool_panic)("mc_pp_AddrInfo");
+         VG_(core_panic)("mc_pp_AddrInfo");
    }
 }
 
index ae04087520a70187b449378acc4e9eb08d7e5f11..0de1529fcbc39d23a96d4fdae0d676002e483401 100644 (file)
@@ -310,7 +310,7 @@ static Bool eq_Error ( VgRes res, Error* e1, Error* e2 )
             VG_(printf)("\nUnhandled error type: %u. VG_(needs).tool_errors\n"
                         "probably needs to be set.\n",
                         e1->ekind);
-            VG_(tool_panic)("unhandled error type");
+            VG_(core_panic)("unhandled error type");
          }
    }
 }
@@ -999,7 +999,7 @@ void VG_(show_all_errors) (  Int verbosity, Bool xml )
          }
       }
       // XXX: this isn't right.  See bug 203651.
-      if (p_min == NULL) continue; //VG_(tool_panic)("show_all_errors()");
+      if (p_min == NULL) continue; //VG_(core_panic)("show_all_errors()");
 
       VG_(umsg)("\n");
       VG_(umsg)("%d errors in context %d of %d:\n",
@@ -1869,7 +1869,7 @@ Bool supp_matches_error(Supp* su, Error* err)
                "\nUnhandled suppression type: %u.  VG_(needs).tool_errors\n"
                "probably needs to be set.\n",
                err->ekind);
-            VG_(tool_panic)("unhandled suppression type");
+            VG_(core_panic)("unhandled suppression type");
          }
    }
 }
index 8d30b00b81cec96e237cf52f7b94a107de901de9..e36776792101e472e179a6b427fdebe79e452062 100644 (file)
@@ -315,7 +315,7 @@ void VG_(percentify)(ULong n, ULong m, UInt d, Int n_buf, HChar buf[])
       case 1: ex = 10;    break;
       case 2: ex = 100;   break;
       case 3: ex = 1000;  break;
-      default: VG_(tool_panic)("Currently can only handle 3 decimal places");
+      default: VG_(core_panic)("Currently can only handle 3 decimal places");
       }
       p2 = ((100*n*ex) / m) % ex;
       // Have to generate the format string in order to be flexible about
index 9663474dde98f18c5f5ee01cefa5f95e59f9b580..94dc4158a82efb25158700d4f28cb1e2f04ce1d1 100644 (file)
@@ -2026,7 +2026,7 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp )
       Bool  ok;
       ok = VG_(sanity_check_needs)( &s );
       if (!ok) {
-         VG_(tool_panic)(s);
+         VG_(core_panic)(s);
       }
    }
 
index dd366d1be40a8560f091b8567832d185decf4240..3c5338674de95c2708561402f83fab3165768cdb 100755 (executable)
@@ -12,6 +12,8 @@
 #     export headers
 # (6) coregrind/ *.[ch] must not use tl_assert
 # (7) include/*.h and tool *.[ch] must not use vg_assert
+# (8) coregrind/ *.[ch] must not use VG_(tool_panic)
+# (9) include/*.h and tool *.[ch] must not use VG_(core_panic)
 #-------------------------------------------------------------------
 
 use strict;
@@ -225,6 +227,11 @@ sub check_coregrind_export_header {
     if ($assert ne "") {
         error("File $path_name must not use vg_assert\n");
     }
+# Must not use VG_(core_panic)
+    my $panic = `grep 'VG_(core_panic)' $file`;
+    if ($panic ne "") {
+        error("File $path_name must not use VG_(core_panic)\n");
+    }
 }
 
 #---------------------------------------------------------------------
@@ -254,6 +261,18 @@ sub check_coregrind_file {
     if ($assert ne "") {
         error("File $path_name must not use tl_assert\n");
     }
+# Must not use VG_(tool_panic)
+    my $panic = `grep 'VG_(tool_panic)' $file`;
+    if ($panic ne "") {
+        chomp($panic);
+# Do not complain about the definition of VG_(tool_panic)
+        if (($path_name eq "coregrind/m_libcassert.c") &&
+            ($panic eq "void VG_(tool_panic) ( const HChar* str )")) {
+# OK
+        } else {
+            error("File $path_name must not use VG_(tool_panic)\n");
+        }
+    }
 }
 
 #---------------------------------------------------------------------
@@ -279,6 +298,11 @@ sub check_tool_file {
     if ($assert ne "") {
         error("File $path_name must not use vg_assert\n");
     }
+# Must not use VG_(core_panic)
+    my $panic = `grep 'VG_(core_panic)' $file`;
+    if ($panic ne "") {
+        error("File $path_name must not use VG_(core_panic)\n");
+    }
 }
 
 sub process_file {