X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FTest%2FValgrind%2FTool%2Fmemcheck.pm;h=c93ad2dbd38fa7a6cba2c55acf2468dd073090b7;hb=8bd140c3f1dcd8d5f9bdca0ce59b315b75d911cf;hp=9ec1aa0762fe972793076efaa28c0755bc3bad3b;hpb=f040b7d40c89671ee109c2554dbb5471fe88b449;p=perl%2Fmodules%2FTest-Valgrind.git diff --git a/lib/Test/Valgrind/Tool/memcheck.pm b/lib/Test/Valgrind/Tool/memcheck.pm index 9ec1aa0..c93ad2d 100644 --- a/lib/Test/Valgrind/Tool/memcheck.pm +++ b/lib/Test/Valgrind/Tool/memcheck.pm @@ -9,11 +9,11 @@ Test::Valgrind::Tool::memcheck - Run an analysis through the memcheck tool. =head1 VERSION -Version 1.01 +Version 1.02 =cut -our $VERSION = '1.01'; +our $VERSION = '1.02'; =head1 DESCRIPTION @@ -92,7 +92,8 @@ This tool emits C object reports in anal sub report_class_analysis { 'Test::Valgrind::Tool::memcheck::Report' } sub args { - my ($self, $sess) = @_; + my $self = shift; + my ($sess) = @_; my @args = ( '--tool=memcheck', @@ -108,7 +109,7 @@ sub args { push @args, '--xml=yes'; } - push @args, $self->SUPER::args(); + push @args, $self->SUPER::args(@_); return @args; } @@ -121,9 +122,6 @@ sub _session { @_ <= 1 ? $_[0]->{_session} : ($_[0]->{_session} = $_[1]) } sub start { my ($self, $sess) = @_; - $self->_croak('This memcheck tool can\'t be run in two sessions at once') - if $self->_session; - $self->SUPER::start($sess); $self->_session($sess); @@ -186,7 +184,7 @@ package Test::Valgrind::Tool::memcheck::Report; use base qw/Test::Valgrind::Report/; -our $VERSION = '1.01'; +our $VERSION = '1.02'; my @kinds = qw/ InvalidFree @@ -258,7 +256,7 @@ sub dump { package Test::Valgrind::Tool::memcheck::Twig; -our $VERSION = '1.01'; +our $VERSION = '1.02'; use Scalar::Util; @@ -323,13 +321,14 @@ sub handle_error { $origin->kid('stack')->children('frame') ]; } - my $report = Test::Valgrind::Tool::memcheck::Report->new( + my $tool = $twig->stash->{tool}; + my $sess = $tool->_session; + + $sess->report($tool->report_class($sess)->new( kind => $kind, id => $id, data => $data, - ); - - $twig->stash->{tool}->_session->report($report); + )); $twig->purge; } @@ -338,7 +337,7 @@ sub handle_error { package Test::Valgrind::Tool::memcheck::Twig::Elt; -our $VERSION = '1.01'; +our $VERSION = '1.02'; BEGIN { require XML::Twig; }