Author: florian
Date: Tue Sep 16 09:28:12 2014
New Revision: 14544
Log:
Fix incorrect use of VG_(tool_panic). Adapt checker script accordingly.
Modified:
trunk/coregrind/m_addrinfo.c
trunk/coregrind/m_errormgr.c
trunk/coregrind/m_libcprint.c
trunk/coregrind/m_main.c
trunk/tests/check_headers_and_includes
Modified: trunk/coregrind/m_addrinfo.c
==============================================================================
--- trunk/coregrind/m_addrinfo.c (original)
+++ trunk/coregrind/m_addrinfo.c Tue Sep 16 09:28:12 2014
@@ -550,7 +550,7 @@
break;
default:
- VG_(tool_panic)("mc_pp_AddrInfo");
+ VG_(core_panic)("mc_pp_AddrInfo");
}
}
Modified: trunk/coregrind/m_errormgr.c
==============================================================================
--- trunk/coregrind/m_errormgr.c (original)
+++ trunk/coregrind/m_errormgr.c Tue Sep 16 09:28:12 2014
@@ -310,7 +310,7 @@
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 @@
}
}
// 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 @@
"\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");
}
}
}
Modified: trunk/coregrind/m_libcprint.c
==============================================================================
--- trunk/coregrind/m_libcprint.c (original)
+++ trunk/coregrind/m_libcprint.c Tue Sep 16 09:28:12 2014
@@ -315,7 +315,7 @@
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
Modified: trunk/coregrind/m_main.c
==============================================================================
--- trunk/coregrind/m_main.c (original)
+++ trunk/coregrind/m_main.c Tue Sep 16 09:28:12 2014
@@ -2026,7 +2026,7 @@
Bool ok;
ok = VG_(sanity_check_needs)( &s );
if (!ok) {
- VG_(tool_panic)(s);
+ VG_(core_panic)(s);
}
}
Modified: trunk/tests/check_headers_and_includes
==============================================================================
--- trunk/tests/check_headers_and_includes (original)
+++ trunk/tests/check_headers_and_includes Tue Sep 16 09:28:12 2014
@@ -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 @@
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 @@
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 @@
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 {
|