File Coverage

lib/Devel/Trepan/CmdProcessor/Command/Show_Subcmd/Display_Subcmd/OP.pm
Criterion Covered Total %
statement 27 27 100.0
branch n/a
condition n/a
subroutine 9 9 100.0
pod n/a
total 36 36 100.0


line stmt bran cond sub pod time code
1             # -*- coding: utf-8 -*-
2             # Copyright (C) 2012, 2014-2015 Rocky Bernstein <rocky@cpan.org>
3 12     12   87 use warnings; no warnings 'redefine'; no warnings 'once';
  12     12   38  
  12     12   650  
  12         80  
  12         39  
  12         418  
  12         74  
  12         40  
  12         421  
4 12     12   81 use rlib '../../../../../..';
  12         41  
  12         83  
5              
6             package Devel::Trepan::CmdProcessor::Command::Show::Display::OP;
7 12     12   5443 use Devel::Trepan::CmdProcessor::Command::Subcmd::Subsubcmd;
  12         36  
  12         282  
8              
9 12     12   77 use strict;
  12         32  
  12         293  
10 12     12   64 use vars qw(@ISA @SUBCMD_VARS);
  12         34  
  12         1056  
11             @ISA = qw(Devel::Trepan::CmdProcessor::Command::ShowBoolSubsubcmd);
12             # Values inherited from parent
13              
14 12     12   70 use vars @Devel::Trepan::CmdProcessor::Command::Subsubcmd::SUBCMD_VARS;
  12         31  
  12         1154  
15              
16             our $IN_LIST = 1;
17 12     12   87 use constant MAX_ARGS => 0;
  12         35  
  12         2638  
18             our $HELP = <<'HELP';
19             =pod
20              
21             Show OP address in debugger location.
22              
23             Showing the OP address allows you to disambiguate
24             I<exactly> where you are in a line that may have many statements or
25             stopping points.
26              
27             In a mult-statement line, the C<deparse> command will print just the
28             current command.
29              
30             =head2 See also:
31              
32             L<C<set display op>|Devel::Trepan::CmdProcessor::Command::Set::Display::OP>,
33             L<C<deparse>|Devel::Trepan::CmdProcessor::Command::Deparse>,
34             L<C<info line>|Devel::Trepan::CmdProcessor::Command::Info::Line>,
35             L<C<info program>|Devel::Trepan::CmdProcessor::Command::Info::Line> and
36             C<disassemble> via plugin L<Devel::Trepan::Disassemble>
37             =cut
38             HELP
39              
40             our $MIN_ABBREV = length('op');
41             our $SHORT_HELP = "Show OP address setting";
42              
43             unless (caller) {
44             # Demo it.
45             # DRY this.
46             require Devel::Trepan::CmdProcessor;
47             my $cmdproc = Devel::Trepan::CmdProcessor->new();
48             my $subcmd = Devel::Trepan::CmdProcessor::Command::Show->new($cmdproc, 'show');
49             my $dispcmd = Devel::Trepan::CmdProcessor::Command::Show::Display->new($subcmd, 'display');
50             my $cmd = Devel::Trepan::CmdProcessor::Command::Show::Display::OP->new($dispcmd, 'op');
51             # Add common routine
52             foreach my $field (qw(min_abbrev name)) {
53             printf "Field %s is: %s\n", $field, $cmd->{$field};
54             }
55             $cmd->run();
56             }
57              
58             1;