From: Nicholas Nethercote Date: Mon, 12 May 2003 20:40:13 +0000 (+0000) Subject: Fixed suppression reading so that you can specify up to four "fun:" or "obj:" X-Git-Tag: svn/VALGRIND_2_0_0~156 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=96c3404d77ccc6e1e2562c1fd1be78313ca5c0ea;p=thirdparty%2Fvalgrind.git Fixed suppression reading so that you can specify up to four "fun:" or "obj:" lines (it was 3 due to a bug). Also removed VG_(get_suppressions)() which wasn't being used, and changed VG_(exitcode) to an Int, as it should be. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1628 --- diff --git a/coregrind/vg_errcontext.c b/coregrind/vg_errcontext.c index f36426e71d..509215220b 100644 --- a/coregrind/vg_errcontext.c +++ b/coregrind/vg_errcontext.c @@ -42,9 +42,6 @@ static Error* vg_errors = NULL; suppressions file. */ static Supp* vg_suppressions = NULL; -/* And a helper function so the leak detector can get hold of it. */ -Supp* VG_(get_suppressions) ( void ) { return vg_suppressions; } - /* Running count of unsuppressed errors detected. */ UInt VG_(n_errs_found) = 0; @@ -218,7 +215,7 @@ void VG_(gen_suppression)(Error* err) return; } - if (stop_at > 3) stop_at = 3; /* At most three names */ + if (stop_at > 4) stop_at = 4; /* At most four names */ vg_assert(stop_at > 0); VG_(printf)("{\n"); @@ -734,11 +731,13 @@ static void load_one_suppressions_file ( Char* filename ) goto syntax_error; /* "i > 0" ensures at least one caller read. */ - for (i = 0; i < VG_N_SUPP_CALLERS; i++) { + for (i = 0; i <= VG_N_SUPP_CALLERS; i++) { eof = VG_(get_line) ( fd, buf, N_BUF ); if (eof) goto syntax_error; if (i > 0 && VG_STREQ(buf, "}")) break; + if (i == VG_N_SUPP_CALLERS) + break; supp->caller[i] = VG_(arena_strdup)(VG_AR_CORE, buf); if (!setLocationTy(&(supp->caller[i]), &(supp->caller_ty[i]))) goto syntax_error; @@ -818,7 +817,7 @@ Bool supp_matches_callers(Supp* su, Char caller_obj[][M_VG_ERRTXT], { Int i; - for (i = 0; su->caller[i] != NULL; i++) { + for (i = 0; i < VG_N_SUPP_CALLERS && su->caller[i] != NULL; i++) { switch (su->caller_ty[i]) { case ObjName: if (VG_(string_match)(su->caller[i], caller_obj[i])) break; diff --git a/coregrind/vg_include.h b/coregrind/vg_include.h index 114a6fd154..206c6d845d 100644 --- a/coregrind/vg_include.h +++ b/coregrind/vg_include.h @@ -1221,10 +1221,6 @@ extern void VG_(record_pthread_error) ( ThreadId tid, Char* msg ); extern void VG_(show_all_errors) ( void ); -/* Get hold of the suppression list ... just so we don't have to - make it global. */ -extern Supp* VG_(get_suppressions) ( void ); - extern Bool VG_(is_action_requested) ( Char* action, Bool* clo ); extern void VG_(gen_suppression) ( Error* err ); @@ -1356,7 +1352,7 @@ extern ThreadId VG_(last_run_tid); /* This is the argument to __NR_exit() supplied by the first thread to call that syscall. We eventually pass that to __NR_exit() for real. */ -extern UInt VG_(exitcode); +extern Int VG_(exitcode); /* --- Counters, for informational purposes only. --- */ diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c index a80a2dacec..99531429b1 100644 --- a/coregrind/vg_main.c +++ b/coregrind/vg_main.c @@ -438,7 +438,7 @@ ThreadId VG_(last_run_tid) = 0; /* This is the argument to __NR_exit() supplied by the first thread to call that syscall. We eventually pass that to __NR_exit() for real. */ -UInt VG_(exitcode) = 0; +Int VG_(exitcode) = 0; /* Tell the logging mechanism whether we are logging to a file descriptor or a socket descriptor. */