File Coverage

lib/Devel/Trepan/CmdProcessor/Command/Next.pm
Criterion Covered Total %
statement 60 70 85.7
branch n/a
condition n/a
subroutine 20 22 90.9
pod 0 2 0.0
total 80 94 85.1


line stmt bran cond sub pod time code
1             # -*- coding: utf-8 -*-
2             # Copyright (C) 2011-2012, 2014 Rocky Bernstein <rocky@cpan.org>
3 12     12   142 use warnings; no warnings 'redefine';
  12     12   35  
  12     1   843  
  12     1   131  
  12         31  
  12         661  
  1         6  
  1         4  
  1         26  
  1         4  
  1         2  
  1         33  
4              
5 12     12   69 use rlib '../../../..';
  12     1   25  
  12         74  
  1         5  
  1         3  
  1         5  
6              
7             # require_relative '../../app/condition'
8              
9             package Devel::Trepan::CmdProcessor::Command::Next;
10              
11 12     12   4705 use if !@ISA, Devel::Trepan::CmdProcessor::Command ;
  12     1   33  
  12         70  
  1         358  
  1         2  
  1         5  
12              
13             unless (@ISA) {
14 12     12   81 eval <<'EOE';
  12     12   29  
  12     12   800  
  12     12   80  
  12     12   26  
  12     12   516  
  12         76  
  12         32  
  12         471  
  12         64  
  12         30  
  12         447  
  12         67  
  12         34  
  12         536  
  12         72  
  12         41  
  12         482  
15             use constant ALIASES => qw(n next+ next- n+ n-);
16             use constant CATEGORY => 'running';
17             use constant SHORT_HELP => 'Step program without entering called functions';
18             use constant MIN_ARGS => 0; # Need at least this many
19             use constant MAX_ARGS => 1; # Need at most this many -
20             # undef -> unlimited.
21             use constant NEED_STACK => 1;
22             EOE
23             }
24              
25 12     12   2004 use strict;
  12     1   28  
  12         302  
  1         57  
  1         3  
  1         24  
26 12     12   68 use vars qw(@ISA); @ISA = @CMD_ISA;
  12     1   26  
  12         571  
  1         5  
  1         1  
  1         47  
27 12     12   73 use vars @CMD_VARS; # Value inherited from parent
  12     1   40  
  12         2698  
  1         5  
  1         2  
  1         170  
28              
29             our $NAME = set_name();
30             =pod
31              
32             =head2 Synopsis:
33              
34             =cut
35             our $HELP = <<'HELP';
36             =pod
37              
38             B<next>[B<+>|B<->] [I<count>]
39              
40             Step one statement ignoring steps into function calls at this level.
41             Sometimes this is called 'step over'.
42              
43             With an integer argument, perform 'next' that many times. However if
44             an exception occurs at this level, or we 'return' or 'yield' or the
45             thread changes, we stop regardless of count.
46              
47             A suffix of C<+> on the command or an alias to the command forces to
48             move to another line, while a suffix of C<-> does the opposite and
49             disables the requiring a move to a new line. If no suffix is given,
50             the debugger setting 'different' determines this behavior.
51              
52             If no suffix is given, the debugger setting 'different'
53             determines this behavior.
54              
55             =head2 Example:
56              
57             next
58              
59             =head2 See also:
60              
61             L<C<step> (step into)|Devel::Trepan::CmdProcessor::Command::Step>,
62             L<C<finish> (step out)|Devel::Trepan::CmdProcessor::Command::Finish>,
63             L<C<continue>|Devel::Trepan::CmdProcessor::Command::Continue>
64              
65             =cut
66             HELP
67              
68             # This method runs the command
69             sub run($$) {
70 0     0 0   my ($self, $args) = @_;
  0     0 0    
71 0           my $proc = $self->{proc};
  0            
72 0           my $opts = $proc->parse_next_step_suffix($args->[0]);
  0            
73              
74             # FIXME: parse and adjust step count
75 0           $proc->{skip_count} = 0;
  0            
76              
77 0           $proc->next($opts);
  0            
78             }
79              
80             unless (caller) {
81             # require_relative '../mock'
82             # dbgr, cmd = MockDebugger::setup
83             # p cmd.run([cmd.name])
84             }
85              
86             1;