]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - lib/Test/Valgrind/Parser/XML/Twig.pm
This is 1.10
[perl/modules/Test-Valgrind.git] / lib / Test / Valgrind / Parser / XML / Twig.pm
index 878ef4de6afe1594bf46b5338c0d0293d4435071..bc0df39dccff942e4d3730ecb6d121149ba47822 100644 (file)
@@ -3,7 +3,7 @@ package Test::Valgrind::Parser::XML::Twig;
 use strict;
 use warnings;
 
-our $VERSION = '1.02';
+our $VERSION = '1.10';
 
 use Scalar::Util ();
 
@@ -82,12 +82,19 @@ sub handle_error {
 
  my $data;
 
- $data->{what}  = $node->kid('what')->text;
+ my ($what, $xwhat);
+ if ($twig->protocol_version >= 4) {
+  $xwhat = $node->first_child('xwhat');
+  $what  = $xwhat->kid('text')->text if defined $xwhat;
+ }
+ $what = $node->kid('what')->text unless defined $what;
+ $data->{what} = $what;
+
  $data->{stack} = [ map $_->listify_frame,
                                        $node->kid('stack')->children('frame') ];
 
  for (qw/leakedbytes leakedblocks/) {
-  my $kid = $node->first_child($_);
+  my $kid = ($xwhat || $node)->first_child($_);
   next unless $kid;
   $data->{$_} = int $kid->text;
  }
@@ -120,7 +127,7 @@ sub handle_error {
 
 package Test::Valgrind::Parser::XML::Twig::Elt;
 
-our $VERSION = '1.02';
+our $VERSION = '1.10';
 
 BEGIN { require XML::Twig; }