X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FTest%2FValgrind%2FParser%2FXML%2FTwig.pm;h=29d0f9681850abb3b7980a34a9cae1b3f304b794;hb=f229eb96e8c03a16ac13b617542554b44023c510;hp=878ef4de6afe1594bf46b5338c0d0293d4435071;hpb=76eed0759a5b942bf1a9a8be439eebd9459f7c7c;p=perl%2Fmodules%2FTest-Valgrind.git diff --git a/lib/Test/Valgrind/Parser/XML/Twig.pm b/lib/Test/Valgrind/Parser/XML/Twig.pm index 878ef4d..29d0f96 100644 --- a/lib/Test/Valgrind/Parser/XML/Twig.pm +++ b/lib/Test/Valgrind/Parser/XML/Twig.pm @@ -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; }