File Coverage

lib/Devel/Trepan/CmdProcessor/Command/Info_Subcmd/Signals.pm
Criterion Covered Total %
statement 30 44 68.1
branch n/a
condition n/a
subroutine 10 14 71.4
pod n/a
total 40 58 68.9


line stmt bran cond sub pod time code
1             # -*- coding: utf-8 -*-
2             # Copyright (C) 2011-2012, 2014, 2016 Rocky Bernstein <rocky@cpan.org>
3              
4 12     12   109 use warnings;
  12     1   35  
  12         769  
  1         8  
  1         2  
  1         31  
5 12     12   80 use rlib '../../../../..';
  12     1   35  
  12         82  
  1         7  
  1         5  
  1         8  
6              
7             package Devel::Trepan::CmdProcessor::Command::Info::Signals;
8             require Devel::Trepan::Complete;
9 12     12   5296 use Devel::Trepan::CmdProcessor::Command::Subcmd::Core;
  12     1   36  
  12         499  
  1         761  
  1         4  
  1         70  
10              
11              
12             @ISA = qw(Devel::Trepan::CmdProcessor::Command::Subcmd);
13             # Values inherited from parent
14 12     12   72 use vars @Devel::Trepan::CmdProcessor::Command::Subcmd::SUBCMD_VARS;
  12     1   36  
  12         2330  
  1         10  
  1         4  
  1         275  
15              
16             unless (@ISA) {
17             eval <<"EOE";
18             use constant MAX_ARGS => undef; # Need at most this many - undef -> unlimited.
19             EOE
20             }
21              
22             our $CMD = "info signals";
23             =pod
24              
25             =head2 Synopsis:
26              
27             =cut
28              
29             our $HELP = <<'HELP';
30             =pod
31              
32             B<info signals>
33              
34             B<info signals> I<signal1> [I<signal2> ..]
35              
36             In the first form a list of the existing signals and actions are shown.
37              
38             In the second form, list just the given signals and their definitions
39             are shown.
40              
41             Signals can be either their signal name or number. The case is not
42             significant when giving a signal name. A signal name C<SIG> or
43             not. For a signal number, you can preface the number with C<+> or
44             C<->, but both are ignored. A negative number is the same as its
45             corresponding positive number.
46              
47             =head2 See also:
48              
49             L<C<handle>|Devel::Trepan::CmdProcessor::Command::Handle> for descriptions of the settable fields shown.
50             =cut
51             HELP
52              
53             our $MIN_ABBREV = length('sig');
54             our $SHORT_HELP = 'What debugger does when program gets various signals';
55              
56 12     12   90 no warnings 'redefine';
  12     1   41  
  12         2105  
  1         10  
  1         4  
  1         268  
57             sub complete($$) {
58 0     0     my ($self, $prefix) = @_;
  0     0      
59 0           my @matches =Devel::Trepan::Complete::signal_complete($prefix);
  0            
60 0           return sort @matches;
  0            
61             }
62              
63             sub run($$) {
64 0     0     my ($self, $args) = @_;
  0     0      
65 0           my $proc = $self->{proc};
  0            
66 0           my @args = splice(@$args, 2);
  0            
67 0           $proc->{dbgr}{sigmgr}->info_signal(\@args);
  0            
68             }
69              
70             unless(caller) {
71             # Demo it.
72             # require_relative '../../mock';
73             # my $cmd = MockDebugger::sub_setup(__PACKAGE__);
74             # my $cmd->run($cmd->{prefix} + %w(u foo));
75             }
76              
77             1;