blib/lib/Devel/Trepan/Deparse.pm

filter: Statementstmt 57.1% 16 / 28 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 2 totaltotal 43.4% 20 / 46 CC 6 SCAR 23.9
CC
6
Cov
42%
pmsg_info
20.0
pmsg
12.0
BEGIN
1.0
CRAP 10.9
« blib/lib/Devel/Trepan/CmdProcessor/Command/Deparse.pm ↑ Summary blib/lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Auto_Subcmd/Deparse.pm »
1 #!/usr/bin/env perl
2 # Copyright (C) 2015, 2018 Rocky Bernstein <rocky@cpan.org>
3 package Devel::Trepan::Deparse;
4 1 our $VERSION='3.1.0';
5 1 ▶use Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings; use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use vars qw(@ISA @EXPORT);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 @ISA = ('Exporter');
10 1 @EXPORT = qw(pmsg pmsg_info);
11  
12 # Print Perl text, possibly syntax highlighted.
13 sub pmsg
14 0 ▶{
Subroutine pmsg: not called CC=3 SCAR=24.8
Pod undocumented
15 0 my ($proc, $text, $short) = @_;
16 0 ▶ $text = B::DeparseTree::Printer::short_str($text, $proc->{settings}{maxwidth}) if $short;
Branch: 1 branch
BranchTrueFalseTotal
if $short 0 0 0
17 $text = Devel::Trepan::DB::LineCache::highlight_string($text)
18 0 ▶ if $proc->{settings}{highlight};
Branch: 1 branch
BranchTrueFalseTotal
if $proc->{"settings"}{"highlight"} 0 0 0
19 0 $proc->msg($text, {unlimited => 1});
20 }
21  
22 # Print Perl text, possibly syntax highlighted.
23 # We add leader info which may have op addresses
24 # if desired
25 sub pmsg_info
26 0 ▶{
Subroutine pmsg_info: not called CC=4 SCAR=30.0
Pod undocumented
27 0 my ($proc, $options, $leader, $info) = @_;
28 0 ▶ return unless $info;
Branch: 1 branch
BranchTrueFalseTotal
unless $info 0 0 0
29 0 my $text = $info->{text};
30 0 ▶ if ($options->{'address'}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($options->{"address"}) 0 0 0
31 0 $leader = sprintf "OP: 0x%0x $leader", ${$info->{op}};
32 }
33 0 ▶ $proc->msg("# ${leader}...") if $leader;
Branch: 1 branch
BranchTrueFalseTotal
if $leader 0 0 0
34 0 pmsg($proc, $text, 1);
35 }
36  
37  
38 1 1;
39  
40 __END__
« blib/lib/Devel/Trepan/CmdProcessor/Command/Deparse.pm ↑ Summary blib/lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Auto_Subcmd/Deparse.pm »