]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - lib/Test/Valgrind/Parser/Suppressions/Text.pm
Z-demangle symbol names in suppressions
[perl/modules/Test-Valgrind.git] / lib / Test / Valgrind / Parser / Suppressions / Text.pm
index 19ef138de0171552e26ddf6b289c81b5c3e0417a..c8e6e9f73ee604c734b34a9059392159a317554a 100644 (file)
@@ -21,6 +21,8 @@ This is a L<Test::Valgrind::Parser::Text> object that can extract suppressions f
 
 =cut
 
+use Test::Valgrind::Suppressions;
+
 use base qw/Test::Valgrind::Parser::Text Test::Valgrind::Carp/;
 
 =head1 METHODS
@@ -44,7 +46,6 @@ sub parse {
   s/^\s*#\s//;        # Strip comments
 
   next if /^==/;      # Valgrind info line
-  next if /valgrind/; # and /\Q$file\E/;
 
   s/^\s*//;           # Strip leading spaces
   s/<[^>]+>//;        # Strip tags
@@ -54,18 +55,19 @@ sub parse {
   if ($_ eq '{') {      # A suppression block begins
    $in = 1;
   } elsif ($_ eq '}') { # A suppression block ends
-   # With valgrind 3.4.0, we can replace unknown series of frames by '...'
-   if ($sess->version ge '3.4.0') {
-    my $unknown_tail;
-    ++$unknown_tail while $s =~ s/(\n)\s*obj:\*\s*$/$1/;
-    $s .= "...\n" if $unknown_tail;
-   }
-
+   $s = Test::Valgrind::Suppressions->strip_tail($sess, $s); # Strip the tail
    push @supps, $s;     # Add the suppression that just ended to the list
    $s  = '';            # Reset the state
    $in = 0;
   } elsif ($in) {       # We're inside a suppresion block
-   $s .= "$_\n";        # Append the current line to the state
+   if (/^fun\s*:\s*(.*)/) {
+    # Sometimes valgrind seems to forget to Z-demangle the symbol names.
+    # Make sure it's done and append the result to the state.
+    my $sym = $1;
+    $s .= 'fun:' . Test::Valgrind::Suppressions->maybe_z_demangle($sym) . "\n";
+   } else {
+    $s .= "$_\n";
+   }
   }
  }