line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Devel::Dt; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
1
|
|
|
1
|
|
26853
|
$Devel::Dt::VERSION = '0.04'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
# ABSTRACT: Kind of emulates command line flag -Dt on normal perl |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
11
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
8
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
9
|
1
|
|
|
1
|
|
11
|
use B (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
10
|
1
|
|
|
1
|
|
1094
|
use B::Utils (); |
|
1
|
|
|
|
|
8946
|
|
|
1
|
|
|
|
|
39
|
|
11
|
1
|
|
|
1
|
|
491
|
use Runops::Trace (); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# use Data::Dump::Streamer (); |
13
|
|
|
|
|
|
|
use IO::Handle; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $Dumper; |
16
|
|
|
|
|
|
|
my $CurrentFile; |
17
|
|
|
|
|
|
|
my $CurrentLine; |
18
|
|
|
|
|
|
|
my $OutputHandle; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub dt { |
21
|
|
|
|
|
|
|
my ( $op, $arity, @args ) = @_; |
22
|
|
|
|
|
|
|
my $name = $op->oldname; |
23
|
|
|
|
|
|
|
my $class = B::class( $op ); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $dumped = ''; |
26
|
|
|
|
|
|
|
if ( @args ) { |
27
|
|
|
|
|
|
|
$dumped = "@args"; |
28
|
|
|
|
|
|
|
# $dumped = $Dumper->Data( \ @args ); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
if ( 'COP' eq $class ) { |
32
|
|
|
|
|
|
|
$CurrentFile = $op->file; |
33
|
|
|
|
|
|
|
$CurrentLine = $op->line; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
$OutputHandle->printf( "(%s:%s) %s=0x%0x\n", $CurrentFile, $CurrentLine, $name, $$op, $dumped ) |
37
|
|
|
|
|
|
|
or warn "Can't write to $OutputHandle: $!"; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
return; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
BEGIN { |
43
|
|
|
|
|
|
|
$CurrentFile = $CurrentLine = '?'; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
$OutputHandle = \ *STDERR; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# $Dumper = Data::Dump::Streamer->new; |
48
|
|
|
|
|
|
|
# |
49
|
|
|
|
|
|
|
# $Dumper->Names( 'args' ); |
50
|
|
|
|
|
|
|
# $Dumper->Purity( 0 ); |
51
|
|
|
|
|
|
|
# $Dumper->Declare( 0 ); |
52
|
|
|
|
|
|
|
# $Dumper->KeyOrder( 'smart' ); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Runops::Trace::enable_global_tracing( \&dt ); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
() = -.0 |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__END__ |