From: Vincent Pit Date: Sat, 19 Sep 2009 23:28:34 +0000 (+0200) Subject: Handle xwhat nodes of protocol v4 X-Git-Tag: v1.10~7 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FTest-Valgrind.git;a=commitdiff_plain;h=c449f79f31a73c4389c3f9ea5cf99c62e68b47ac Handle xwhat nodes of protocol v4 --- diff --git a/lib/Test/Valgrind/Parser/XML/Twig.pm b/lib/Test/Valgrind/Parser/XML/Twig.pm index 878ef4d..318e2db 100644 --- a/lib/Test/Valgrind/Parser/XML/Twig.pm +++ b/lib/Test/Valgrind/Parser/XML/Twig.pm @@ -82,7 +82,14 @@ 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') ];