line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- coding: utf-8 -*- |
2
|
|
|
|
|
|
|
# Copyright (C) 2011-2012, 2014 Rocky Bernstein <rocky@cpan.org> |
3
|
12
|
|
|
12
|
|
151
|
use warnings; use utf8; |
|
12
|
|
|
12
|
|
38
|
|
|
12
|
|
|
1
|
|
444
|
|
|
12
|
|
|
1
|
|
81
|
|
|
12
|
|
|
|
|
34
|
|
|
12
|
|
|
|
|
89
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
23
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
4
|
12
|
|
|
12
|
|
340
|
use rlib '../../../../..'; |
|
12
|
|
|
1
|
|
33
|
|
|
12
|
|
|
|
|
72
|
|
|
1
|
|
|
|
|
27
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Devel::Trepan::CmdProcessor::Command::Info::Frame; |
7
|
|
|
|
|
|
|
|
8
|
12
|
|
|
12
|
|
5552
|
use Devel::Trepan::CmdProcessor::Command::Subcmd::Core; |
|
12
|
|
|
1
|
|
34
|
|
|
12
|
|
|
|
|
304
|
|
|
1
|
|
|
|
|
381
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
9
|
|
|
|
|
|
|
|
10
|
12
|
|
|
12
|
|
68
|
use strict; |
|
12
|
|
|
1
|
|
35
|
|
|
12
|
|
|
|
|
685
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
44
|
|
11
|
|
|
|
|
|
|
our (@ISA, @SUBCMD_VARS); |
12
|
|
|
|
|
|
|
# Values inherited from parent |
13
|
12
|
|
|
12
|
|
72
|
use vars @Devel::Trepan::CmdProcessor::Command::Subcmd::SUBCMD_VARS; |
|
12
|
|
|
1
|
|
30
|
|
|
12
|
|
|
|
|
2612
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
168
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
## FIXME: do automatically. |
16
|
|
|
|
|
|
|
our $CMD = "info frame"; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
unless (@ISA) { |
19
|
12
|
|
|
12
|
|
97
|
eval <<"EOE"; |
|
12
|
|
|
|
|
46
|
|
|
12
|
|
|
|
|
703
|
|
20
|
|
|
|
|
|
|
use constant MAX_ARGS => 1; # Need at most this many - undef -> unlimited. |
21
|
|
|
|
|
|
|
EOE |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
@ISA = qw(Devel::Trepan::CmdProcessor::Command::Subcmd); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=pod |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 Synopsis: |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
our $HELP = <<"HELP"; |
32
|
|
|
|
|
|
|
=pod |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
B<info frame> [I<frame-num>] |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Show information about I<frame-num>. If no frame number is given, use |
37
|
|
|
|
|
|
|
the selected frame |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 See also: |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
L<C<info variables my>|Devel::Trepan::CmdProcessor::Command::Info::Variables::My>> and L<C<info variables our>|Devel::Trepan::CmdProcessor::Command::Info::::Variables::Our>. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
HELP |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
our $SHORT_HELP = 'Show information about the selected frame'; |
47
|
|
|
|
|
|
|
our $MIN_ABBREV = length('fr'); |
48
|
|
|
|
|
|
|
|
49
|
12
|
|
|
12
|
|
95
|
no warnings 'redefine'; |
|
12
|
|
|
1
|
|
36
|
|
|
12
|
|
|
|
|
5809
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
510
|
|
50
|
|
|
|
|
|
|
sub complete($$) |
51
|
|
|
|
|
|
|
{ |
52
|
0
|
|
|
0
|
|
|
my ($self, $prefix) = @_; |
|
0
|
|
|
0
|
|
|
|
53
|
0
|
|
|
|
|
|
$self->{proc}->frame_complete($prefix, 1); |
|
0
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub run($$) |
57
|
|
|
|
|
|
|
{ |
58
|
0
|
|
|
0
|
|
|
my ($self, $args) = @_; |
|
0
|
|
|
0
|
|
|
|
59
|
0
|
|
|
|
|
|
my $proc = $self->{proc}; |
|
0
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
my ($frame, $frame_num); |
|
0
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
0
|
0
|
|
|
|
|
if (@$args == 3) { |
|
0
|
0
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
my ($low, $high) = $proc->frame_low_high(0); |
|
0
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
my $opts = { |
|
0
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
min_value => $low, |
66
|
|
|
|
|
|
|
max_value => $high |
67
|
|
|
|
|
|
|
}; |
68
|
0
|
|
|
|
|
|
$frame_num = $proc->get_an_int($args->[2], $opts); |
|
0
|
|
|
|
|
|
|
69
|
0
|
0
|
|
|
|
|
return unless defined $frame_num; |
|
0
|
0
|
|
|
|
|
|
70
|
0
|
0
|
|
|
|
|
$frame_num += $proc->{stack_size} if $frame_num < 0; |
|
0
|
0
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
$frame = $proc->{frames}[$frame_num]; |
|
0
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
} else { |
73
|
0
|
|
|
|
|
|
$frame_num = $proc->{frame_index}; |
|
0
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
|
$frame = $proc->{frame}; |
|
0
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
my $is_last = $frame_num == $proc->{stack_size}-1; |
|
0
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
|
my $m = sprintf("Frame %2d", $frame_num); |
|
0
|
|
|
|
|
|
|
79
|
0
|
|
|
|
|
|
$proc->section($m); |
|
0
|
|
|
|
|
|
|
80
|
0
|
|
|
|
|
|
my @titles = qw(package function file line); |
|
0
|
|
|
|
|
|
|
81
|
0
|
|
|
|
|
|
my $i=-1; |
|
0
|
|
|
|
|
|
|
82
|
0
|
|
|
|
|
|
for my $field (qw(pkg fn file line)) { |
|
0
|
|
|
|
|
|
|
83
|
0
|
|
|
|
|
|
$i++; |
|
0
|
|
|
|
|
|
|
84
|
0
|
0
|
0
|
|
|
|
next unless exists $frame->{$field} && $frame->{$field}; |
|
0
|
0
|
0
|
|
|
|
|
85
|
0
|
0
|
0
|
|
|
|
next if $field eq 'fn' && $is_last; |
|
0
|
0
|
0
|
|
|
|
|
86
|
0
|
|
|
|
|
|
$m = " ${titles[$i]}: " . $frame->{$field}; |
|
0
|
|
|
|
|
|
|
87
|
0
|
|
|
|
|
|
$proc->msg($m); |
|
0
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
} |
89
|
0
|
|
|
|
|
|
my $cop = Devel::Callsite::callsite($frame_num); |
|
0
|
|
|
|
|
|
|
90
|
0
|
|
|
|
|
|
$proc->msg(sprintf " OP address: 0x%x.", $cop); |
|
0
|
|
|
|
|
|
|
91
|
0
|
0
|
|
|
|
|
if ($is_last) { |
|
0
|
0
|
|
|
|
|
|
92
|
0
|
|
|
|
|
|
$proc->msg(" Bottom-most (least recent) frame"); |
|
0
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
return |
94
|
0
|
|
|
|
|
|
} |
|
0
|
|
|
|
|
|
|
95
|
0
|
|
|
|
|
|
for my $field (qw(wantarray is_require)) { |
|
0
|
|
|
|
|
|
|
96
|
0
|
0
|
|
|
|
|
next unless $frame->{$field}; |
|
0
|
0
|
|
|
|
|
|
97
|
0
|
|
|
|
|
|
$m = " ${field}: " . $frame->{$field}; |
|
0
|
|
|
|
|
|
|
98
|
0
|
|
|
|
|
|
$proc->msg($m); |
|
0
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
} |
100
|
0
|
|
|
|
|
|
my $args_ary = $frame->{args}; |
|
0
|
|
|
|
|
|
|
101
|
0
|
0
|
|
|
|
|
if ($args_ary) { |
|
0
|
0
|
|
|
|
|
|
102
|
0
|
|
|
|
|
|
$m = sprintf " args: %s", join(', ', @$args_ary); |
|
0
|
|
|
|
|
|
|
103
|
0
|
|
|
|
|
|
$proc->msg($m); |
|
0
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
unless (caller) { |
108
|
|
|
|
|
|
|
require Devel::Trepan; |
109
|
|
|
|
|
|
|
# Demo it. |
110
|
|
|
|
|
|
|
# require_relative '../../mock' |
111
|
|
|
|
|
|
|
# my($dbgr, $parent_cmd) = MockDebugger::setup('show'); |
112
|
|
|
|
|
|
|
# $cmd = __PACKAGE__->new(parent_cmd); |
113
|
|
|
|
|
|
|
# $cmd->run(@$cmd->prefix); |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
# Suppress a "used-once" warning; |
117
|
|
|
|
|
|
|
$HELP || scalar @SUBCMD_VARS; |