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
|
|
114
|
use warnings; no warnings 'redefine'; no warnings 'once'; |
|
12
|
|
|
12
|
|
39
|
|
|
12
|
|
|
12
|
|
471
|
|
|
12
|
|
|
1
|
|
72
|
|
|
12
|
|
|
1
|
|
32
|
|
|
12
|
|
|
1
|
|
382
|
|
|
12
|
|
|
|
|
70
|
|
|
12
|
|
|
|
|
33
|
|
|
12
|
|
|
|
|
328
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
25
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
4
|
12
|
|
|
12
|
|
118
|
use rlib '../../../../..'; |
|
12
|
|
|
1
|
|
30
|
|
|
12
|
|
|
|
|
73
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Devel::Trepan::CmdProcessor::Command::Info::Functions; |
7
|
|
|
|
|
|
|
|
8
|
12
|
|
|
12
|
|
5318
|
use Devel::Trepan::CmdProcessor::Command::Subcmd::Core; |
|
12
|
|
|
1
|
|
35
|
|
|
12
|
|
|
|
|
282
|
|
|
1
|
|
|
|
|
489
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
42
|
|
9
|
|
|
|
|
|
|
|
10
|
12
|
|
|
12
|
|
71
|
use strict; |
|
12
|
|
|
1
|
|
31
|
|
|
12
|
|
|
|
|
583
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
78
|
|
11
|
|
|
|
|
|
|
our (@ISA, @SUBCMD_VARS); |
12
|
|
|
|
|
|
|
# Values inherited from parent |
13
|
12
|
|
|
12
|
|
74
|
use vars @Devel::Trepan::CmdProcessor::Command::Subcmd::SUBCMD_VARS; |
|
12
|
|
|
1
|
|
38
|
|
|
12
|
|
|
|
|
7294
|
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
941
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
## FIXME: do automatically. |
16
|
|
|
|
|
|
|
our $CMD = "info functions"; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
unless (@ISA) { |
19
|
12
|
|
|
12
|
|
93
|
eval <<"EOE"; |
|
12
|
|
|
|
|
39
|
|
|
12
|
|
|
|
|
603
|
|
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
|
|
|
|
|
|
|
=pod |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head2 Synopsis: |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
29
|
|
|
|
|
|
|
our $HELP = <<'HELP'; |
30
|
|
|
|
|
|
|
=pod |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
B<info functions> [I<regexp>] |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Give functions names or those matching I<regexp>. If no regular |
35
|
|
|
|
|
|
|
expresion is given, list all functions. |
36
|
|
|
|
|
|
|
=cut |
37
|
|
|
|
|
|
|
HELP |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
our $SHORT_HELP = 'All function names, or those matching REGEXP'; |
40
|
|
|
|
|
|
|
our $MIN_ABBREV = length('fu'); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub complete($$) |
43
|
|
|
|
|
|
|
{ |
44
|
0
|
|
|
0
|
|
|
my ($self, $prefix) = @_; |
|
0
|
|
|
0
|
|
|
|
45
|
0
|
|
|
|
|
|
Devel::Trepan::Complete::complete_subs($prefix); |
|
0
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub run($$) |
49
|
|
|
|
|
|
|
{ |
50
|
0
|
|
|
0
|
|
|
my ($self, $args) = @_; |
|
0
|
|
|
0
|
|
|
|
51
|
0
|
|
|
|
|
|
my $proc = $self->{proc}; |
|
0
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
my $regexp = undef; |
|
0
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
0
|
0
|
|
|
|
|
if (@$args == 3) { |
|
0
|
0
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
$regexp = $args->[2]; |
|
0
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
my @functions = keys %DB::sub; |
|
0
|
|
|
|
|
|
|
59
|
0
|
0
|
|
|
|
|
@functions = grep /$regexp/, @functions if defined $regexp; |
|
0
|
0
|
|
|
|
|
|
60
|
0
|
0
|
|
|
|
|
if (scalar @functions) { |
|
0
|
0
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
my %FILES = (); |
|
0
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
for my $function (sort @functions) { |
|
0
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
my $file_range = $DB::sub{$function}; |
|
0
|
|
|
|
|
|
|
64
|
0
|
0
|
|
|
|
|
if ($file_range =~ /^(.+):(\d+-\d+)/) { |
|
0
|
0
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
my ($filename, $range) = ($1, $2); |
|
0
|
|
|
|
|
|
|
66
|
0
|
|
0
|
|
|
|
$FILES{$filename} ||= []; |
|
0
|
|
0
|
|
|
|
|
67
|
0
|
|
|
|
|
|
push @{$FILES{$filename}}, [$function, $range]; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
} else { |
69
|
0
|
|
0
|
|
|
|
$FILES{$file_range} ||= []; |
|
0
|
|
0
|
|
|
|
|
70
|
0
|
|
|
|
|
|
push @{$FILES{$file_range}}, [$function]; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
# FIXME: make output more like gdb's. |
74
|
0
|
|
|
|
|
|
for my $filename (sort keys %FILES) { |
|
0
|
|
|
|
|
|
|
75
|
0
|
|
|
|
|
|
$proc->section($filename); |
|
0
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
for my $entry (@{$FILES{$filename}}) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
$proc->msg("\t" . join(' is at ', @$entry)); |
|
0
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
} else { |
81
|
0
|
|
|
|
|
|
my @fns = Devel::Trepan::Complete::complete_builtins($regexp); |
|
0
|
|
|
|
|
|
|
82
|
0
|
0
|
|
|
|
|
if (@fns) { |
|
0
|
0
|
|
|
|
|
|
83
|
0
|
|
|
|
|
|
for my $entry (@fns) { |
|
0
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
$proc->msg($entry . ' is a built-in function'); |
|
0
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
} else { |
87
|
0
|
|
|
|
|
|
$proc->msg("No matching functions"); |
|
0
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
unless (caller) { |
93
|
|
|
|
|
|
|
require Devel::Trepan; |
94
|
|
|
|
|
|
|
# Demo it. |
95
|
|
|
|
|
|
|
# require_relative '../../mock' |
96
|
|
|
|
|
|
|
# my($dbgr, $parent_cmd) = MockDebugger::setup('show'); |
97
|
|
|
|
|
|
|
# $cmd = __PACKAGE__->new(parent_cmd); |
98
|
|
|
|
|
|
|
# $cmd->run(@$cmd->prefix); |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
# Suppress a "used-once" warning; |
102
|
|
|
|
|
|
|
$HELP || scalar @SUBCMD_VARS; |