]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fixed suppression reading so that you can specify up to four "fun:" or "obj:"
authorNicholas Nethercote <njn@valgrind.org>
Mon, 12 May 2003 20:40:13 +0000 (20:40 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Mon, 12 May 2003 20:40:13 +0000 (20:40 +0000)
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

coregrind/vg_errcontext.c
coregrind/vg_include.h
coregrind/vg_main.c

index f36426e71d151bb167d6a4bc7766763937cab3c2..509215220b08db040e07e9d1f10a43a1368cc288 100644 (file)
@@ -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;
index 114a6fd154eb19331d1929e622e2b2a56d5cdd8a..206c6d845d4e5754709d77017915bedbcbb3223d 100644 (file)
@@ -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. --- */
index a80a2dacecc61c55e4020ac62d59fd792c9763b7..99531429b11028f79630f8a9cd5b8e65c219b6d8 100644 (file)
@@ -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. */