]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - lib/Test/Valgrind/Parser/Suppressions/Text.pm
Bump copyright year
[perl/modules/Test-Valgrind.git] / lib / Test / Valgrind / Parser / Suppressions / Text.pm
index 6eb2dfcf54b2e44da1b537066bfa64e78a478e2b..f930f109d152dbc724a4d485396c868ab079e529 100644 (file)
@@ -9,11 +9,11 @@ Test::Valgrind::Parser::Suppressions::Text - Parse valgrind suppressions output
 
 =head1 VERSION
 
-Version 1.11
+Version 1.12
 
 =cut
 
-our $VERSION = '1.11';
+our $VERSION = '1.12';
 
 =head1 DESCRIPTION
 
@@ -23,7 +23,7 @@ This is a L<Test::Valgrind::Parser::Text> object that can extract suppressions f
 
 use Test::Valgrind::Suppressions;
 
-use base qw/Test::Valgrind::Parser::Text Test::Valgrind::Carp/;
+use base qw<Test::Valgrind::Parser::Text Test::Valgrind::Carp>;
 
 =head1 METHODS
 
@@ -46,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
@@ -61,7 +60,14 @@ sub parse {
    $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";
+   }
   }
  }
 
@@ -73,11 +79,11 @@ sub parse {
 
    my %call; # Frames to append (if the value is 1) or to prepend (if it's 0)
    if ($t eq 'm') {       # malloc can also be called by calloc or realloc
-    $call{$_} = 1 for qw/calloc realloc/;
+    $call{$_} = 1 for qw<calloc realloc>;
    } elsif ($t eq 're') { # realloc can also call malloc or free
-    $call{$_} = 0 for qw/malloc free/;
+    $call{$_} = 0 for qw<malloc free>;
    } elsif ($t eq 'c') {  # calloc can also call malloc
-    $call{$_} = 0 for qw/malloc/;
+    $call{$_} = 0 for qw<malloc>;
    }
 
    my $c = $_;
@@ -122,7 +128,7 @@ You can find documentation for this module with the perldoc command.
 
 =head1 COPYRIGHT & LICENSE
 
-Copyright 2009 Vincent Pit, all rights reserved.
+Copyright 2009,2010,2011 Vincent Pit, all rights reserved.
 
 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
 
@@ -132,7 +138,7 @@ This program is free software; you can redistribute it and/or modify it under th
 
 package Test::Valgrind::Report::Suppressions;
 
-use base qw/Test::Valgrind::Report/;
+use base qw<Test::Valgrind::Report>;
 
 sub kinds { shift->SUPER::kinds(), 'Suppression' }