]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - lib/Test/Valgrind/Parser/XML/Twig.pm
With protocol v4, leakedbytes and leakedblocks are found in the xwhat node
[perl/modules/Test-Valgrind.git] / lib / Test / Valgrind / Parser / XML / Twig.pm
index 878ef4de6afe1594bf46b5338c0d0293d4435071..29d0f9681850abb3b7980a34a9cae1b3f304b794 100644 (file)
@@ -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;
  }