]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - lib/Test/Valgrind/Tool/memcheck.pm
Fix non-portable hex numbers
[perl/modules/Test-Valgrind.git] / lib / Test / Valgrind / Tool / memcheck.pm
index c1ec7e1093029883c87689e22a942e48842b8f62..281d3f3c7dca8120956d5fd0a2173e8cd848e161 100644 (file)
@@ -9,15 +9,15 @@ Test::Valgrind::Tool::memcheck - Run an analysis through the memcheck tool.
 
 =head1 VERSION
 
-Version 1.10
+Version 1.11
 
 =cut
 
-our $VERSION = '1.10';
+our $VERSION = '1.11';
 
 =head1 DESCRIPTION
 
-This tool parses the XML output of a C<memcheck> run with L<XML::Twig>.
+This class contains the information required by the session for running the C<memcheck> tool.
 
 =cut
 
@@ -75,7 +75,7 @@ sub suppressions_tag { 'memcheck-' . $_[1]->version }
 
 =head2 C<parser_class $session>
 
-This tool uses a C<Test::Valgrind::Parser::XML::Twig> parser in analysis mode, and a C<Test::Valgrind::Parser::Suppressions::Text> parser in suppressions mode.
+This tool uses a L<Test::Valgrind::Parser::XML::Twig> parser in analysis mode, and a L<Test::Valgrind::Parser::Suppressions::Text> parser in suppressions mode.
 
 =cut
 
@@ -94,7 +94,7 @@ sub parser_class {
 
 =head2 C<report_class $session>
 
-This tool emits C<Test::Valgrind::Tool::memcheck::Report> object reports in analysis mode.
+This tool emits C<Test::Valgrind::Tool::memcheck::Report> object reports in analysis mode, and C<Test::Valgrind::Report::Suppressions> object reports in suppressions mode.
 
 =cut
 
@@ -130,8 +130,6 @@ sub args {
 
 L<Test::Valgrind>, L<Test::Valgrind::Tool>.
 
-L<XML::Twig>.
-
 =head1 AUTHOR
 
 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
@@ -163,7 +161,7 @@ package Test::Valgrind::Tool::memcheck::Report;
 
 use base qw/Test::Valgrind::Report/;
 
-our $VERSION = '1.10';
+our $VERSION = '1.11';
 
 my @kinds = qw/
  InvalidFree
@@ -218,9 +216,9 @@ sub dump {
    my ($ip, $obj, $fn, $dir, $file, $line) = map { (defined) ? $_ : '?' } @$_;
    my $frame;
    if ($fn eq '?' and $obj eq '?') {
-    $ip =~ s/^0x//g;
-    $ip = hex $ip;
-    $frame = sprintf "0x%0${pad}X", $ip;
+    $ip =~ s/^0x//gi;
+    my $l = length $ip;
+    $frame = '0x' . ($l < $pad ? ('0' x ($pad - $l)) : '') . uc($ip);
    } else {
     $frame = sprintf '%s (%s) [%s:%s]', $fn, $obj, $file, $line;
    }