« 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
| |||||||||||
| 17 | $text = Devel::Trepan::DB::LineCache::highlight_string($text) | ||||||||||
| 18 | 0 | ▶ | if $proc->{settings}{highlight}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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
| |||||||||||
| 29 | 0 | my $text = $info->{text}; | |||||||||
| 30 | 0 | ▶ | if ($options->{'address'}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 0 | $leader = sprintf "OP: 0x%0x $leader", ${$info->{op}}; | |||||||||
| 32 | } | ||||||||||
| 33 | 0 | ▶ | $proc->msg("# ${leader}...") if $leader; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | 0 | pmsg($proc, $text, 1); | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | |||||||||||
| 38 | 1 | 1; | |||||||||
| 39 | |||||||||||
| 40 | __END__ | ||||||||||