line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# You may distribute under the terms of either the GNU General Public License |
2
|
|
|
|
|
|
|
# or the Artistic License (the same terms as Perl itself) |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# (C) Paul Evans, 2019 -- leonerd@leonerd.org.uk |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Devel::MAT::Tool::Stack 0.50; |
7
|
|
|
|
|
|
|
|
8
|
5
|
|
|
5
|
|
3835
|
use v5.14; |
|
5
|
|
|
|
|
20
|
|
9
|
5
|
|
|
5
|
|
31
|
use warnings; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
183
|
|
10
|
5
|
|
|
5
|
|
33
|
use base qw( Devel::MAT::Tool ); |
|
5
|
|
|
|
|
23
|
|
|
5
|
|
|
|
|
568
|
|
11
|
|
|
|
|
|
|
|
12
|
5
|
|
|
5
|
|
33
|
use constant CMD => "stack"; |
|
5
|
|
|
|
|
23
|
|
|
5
|
|
|
|
|
307
|
|
13
|
5
|
|
|
5
|
|
46
|
use constant CMD_DESC => "Display the value stack"; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
940
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 NAME |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
C - display the value stack |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
This C tool displays the captured state of the value stack, |
22
|
|
|
|
|
|
|
showing the SVs in place there. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=cut |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 COMMANDS |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 stack |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
pmat> stack |
31
|
|
|
|
|
|
|
[1]: SCALAR(PV) at 0x55cde0fa0830 = "tiny.pmat" |
32
|
|
|
|
|
|
|
[0]: UNDEF at 0x55cde0f71398 |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Prints SVs on the value stack. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub run |
39
|
|
|
|
|
|
|
{ |
40
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
my @stacksvs = $self->df->stack; |
43
|
0
|
|
|
|
|
|
foreach my $idx ( reverse 0 .. $#stacksvs ) { |
44
|
0
|
|
|
|
|
|
my $sv = $stacksvs[$idx]; |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
Devel::MAT::Cmd->printf( "[%d]: %s\n", |
47
|
|
|
|
|
|
|
$idx, Devel::MAT::Cmd->format_sv_with_value( $sv ) |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
0x55AA; |