« lib/Devel/Trepan/CmdProcessor/Command/Watch.pm
↑ Summary
blib/lib/Devel/Trepan/CmdProcessor/Command/Info_Subcmd/Variables.pm »
| 1 | # -*- coding: utf-8 -*- | ||
| 2 | # Copyright (C) 2011-2012, 2014, 2016 Rocky Bernstein <rocky@cpan.org> | ||
| 3 | |||
| 4 | use warnings; | ||
| 5 | use rlib '../../../../..'; | ||
| 6 | |||
| 7 | package Devel::Trepan::CmdProcessor::Command::Info::Signals; | ||
| 8 | require Devel::Trepan::Complete; | ||
| 9 | use Devel::Trepan::CmdProcessor::Command::Subcmd::Core; | ||
| 10 | |||
| 11 | |||
| 12 | @ISA = qw(Devel::Trepan::CmdProcessor::Command::Subcmd); | ||
| 13 | # Values inherited from parent | ||
| 14 | use vars @Devel::Trepan::CmdProcessor::Command::Subcmd::SUBCMD_VARS; | ||
| 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 | no warnings 'redefine'; | ||
| 57 | sub complete($$) { | ||
| 58 | my ($self, $prefix) = @_; | ||
| 59 | my @matches =Devel::Trepan::Complete::signal_complete($prefix); | ||
| 60 | return sort @matches; | ||
| 61 | } | ||
| 62 | |||
| 63 | sub run($$) { | ||
| 64 | my ($self, $args) = @_; | ||
| 65 | my $proc = $self->{proc}; | ||
| 66 | my @args = splice(@$args, 2); | ||
| 67 | $proc->{dbgr}{sigmgr}->info_signal(\@args); | ||
| 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; |