From: Florian Krohm Date: Tue, 16 Sep 2014 09:28:12 +0000 (+0000) Subject: Fix incorrect use of VG_(tool_panic). Adapt checker script accordingly. X-Git-Tag: svn/VALGRIND_3_11_0~988 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc2fb329cfc4c6301a368387f7111377034114c2;p=thirdparty%2Fvalgrind.git Fix incorrect use of VG_(tool_panic). Adapt checker script accordingly. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14544 --- diff --git a/coregrind/m_addrinfo.c b/coregrind/m_addrinfo.c index 21fd41358a..05566fdcc3 100644 --- a/coregrind/m_addrinfo.c +++ b/coregrind/m_addrinfo.c @@ -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"); } } diff --git a/coregrind/m_errormgr.c b/coregrind/m_errormgr.c index ae04087520..0de1529fcb 100644 --- a/coregrind/m_errormgr.c +++ b/coregrind/m_errormgr.c @@ -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"); } } } diff --git a/coregrind/m_libcprint.c b/coregrind/m_libcprint.c index 8d30b00b81..e367767921 100644 --- a/coregrind/m_libcprint.c +++ b/coregrind/m_libcprint.c @@ -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 diff --git a/coregrind/m_main.c b/coregrind/m_main.c index 9663474dde..94dc4158a8 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -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); } } diff --git a/tests/check_headers_and_includes b/tests/check_headers_and_includes index dd366d1be4..3c5338674d 100755 --- a/tests/check_headers_and_includes +++ b/tests/check_headers_and_includes @@ -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 {