File Coverage

lib/Devel/ebug/Plugin/Run.pm
Criterion Covered Total %
statement 34 34 100.0
branch 2 2 100.0
condition 1 2 50.0
subroutine 8 8 100.0
pod 0 5 0.0
total 45 51 88.2


line stmt bran cond sub pod time code
1             package Devel::ebug::Plugin::Run;
2              
3 19     19   22424 use strict;
  19         37  
  19         583  
4 19     19   85 use warnings;
  19         32  
  19         493  
5 19     19   88 use base qw(Exporter);
  19         32  
  19         7795  
6             our @EXPORT = qw(undo run return step next);
7              
8             our $VERSION = '0.62_01'; # TRIAL VERSION
9             $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval)
10              
11             # undo
12             sub undo {
13 4     4 0 1941 my($self, $levels) = @_;
14 4   50     65 $levels ||= 1;
15 4         24 my $response = $self->talk({ command => "commands" });
16 4         15 my @commands = @{$response->{commands}};
  4         19  
17 4         26 pop @commands foreach 1..$levels;
18             # use YAML; warn Dump \@commands;
19 4         24 my $proc = $self->proc;
20 4         50 $proc->die;
21 4         7541 $self->load;
22 4         138 $self->talk($_) foreach @commands;
23 4         20 $self->basic;
24             }
25              
26              
27              
28             # run until a breakpoint
29             sub run {
30 50     50 0 39128 my($self) = @_;
31 50         441 my $response = $self->talk({ command => "run" });
32 50         370 $self->basic; # get basic information for the new line
33             }
34              
35              
36             # return from a subroutine
37             sub return {
38 2     2 0 4791 my($self, @values) = @_;
39 2         5 my $values;
40 2 100       18 $values = \@values if @values;
41 2         34 my $response = $self->talk({
42             command => "return",
43             values => $values,
44             });
45 2         15 $self->basic; # get basic information for the new line
46             }
47              
48              
49              
50             # step onto the next line (going into subroutines)
51             sub step {
52 57     57 0 61166 my($self) = @_;
53 57         342 my $response = $self->talk({ command => "step" });
54 57         301 $self->basic; # get basic information for the new line
55             }
56              
57             # step onto the next line (going over subroutines)
58             sub next {
59 17     17 0 26816 my($self) = @_;
60 17         81 my $response = $self->talk({ command => "next" });
61 17         81 $self->basic; # get basic information for the new line
62             }
63              
64             1;
65              
66             __END__