File Coverage

blib/lib/Enbugger/trepan.pm
Criterion Covered Total %
statement 0 28 0.0
branch 0 2 0.0
condition n/a
subroutine 0 6 0.0
pod n/a
total 0 36 0.0


line stmt bran cond sub pod time code
1             package Enbugger::trepan;
2             $Enbugger::trepan::VERSION = '2.016';
3             # COPYRIGHT AND LICENCE
4             #
5             # Copyright (C) 2007,2008 WhitePages.com, Inc. with primary
6             # development by Joshua ben Jore.
7             #
8             # This program is distributed WITHOUT ANY WARRANTY, including but not
9             # limited to the implied warranties of merchantability or fitness for
10             # a particular purpose.
11             #
12             # The program is free software. You may distribute it and/or modify
13             # it under the terms of the GNU General Public License as published by
14             # the Free Software Foundation (either version 2 or any later version)
15             # and the Perl Artistic License as published by O’Reilly Media, Inc.
16             # Please open the files named gpl-2.0.txt and Artistic for a copy of
17             # these licenses.
18              
19              
20             =head1 NAME
21              
22             Enbugger::trepan - subclass for the extraordinary trepanning debugger
23             =cut
24              
25              
26 0     0     use strict;
  0            
  0            
27 0     0     use vars qw( @ISA @Symbols );
  0            
  0            
28 0     0     BEGIN { @ISA = 'Enbugger' }
29              
30              
31             =head1 OVERRIDEN METHODS
32              
33             =over
34              
35             =item CLASS-E_load_debugger
36              
37             =cut
38              
39             sub _load_debugger {
40 0     0     my ( $class ) = @_;
41              
42 0           $class->_compile_with_nextstate();
43 0           require Devel::Trepan::Core;
44 0           $^P |= 0x73f;
45 0           $class->_compile_with_dbstate();
46              
47 0           $class->init_debugger;
48              
49 0           return;
50             }
51              
52              
53              
54              
55              
56             =item CLASS-E_stop ( [OPTION_HASH_REF] )
57              
58             Set to stop at the next stopping point. OPTIONS_HASH_REF is an
59             optional hash reference which can be used to things in the debugger.
60              
61             =cut
62              
63             1 if $DB::signal;
64             sub _stop {
65              
66 0     0     my ($self, $opts) = @_;
67 0           $Devel::Trepan::Core::dbgr->awaken($opts);
68              
69             # trepan looks for these to stop.
70 0           $DB::in_debugger = 1;
71 0           $DB::signal = 2;
72             # Use at least the default debug flags and
73             # eval string saving.
74 0           $^P |= 0x73f;
75 0           $DB::event = 'debugger-call';
76 0           my ($pkg, $filename, $line) = caller;
77 0 0         if ($filename =~ /^\(eval \d+\)/) {
78 0           @DB::dbline = map "$_\n", split(/\n/, $DB::eval_string);
79             }
80 0           $DB::in_debugger = 0;
81 0           return;
82             }
83              
84              
85              
86              
87              
88             =item CLASS-E_write( TEXT )
89              
90             =cut
91              
92             1 if $DB::OUT;
93             sub _write {
94              
95 0     0     for my $c (@DB::clients) {
96 0           $c->output(@_);
97             }
98 0           return;
99             }
100              
101              
102              
103              
104              
105             =back
106              
107             =cut
108              
109              
110              
111              
112             # Load up a list of symbols known to be associated with this
113             # debugger. Enbugger, the base class will use this to guess at which
114             # debugger has been loaded if it was loaded prior to Enbugger being
115             # around.
116             1 if %Enbugger::RegisteredDebuggers;
117             $Enbugger::RegisteredDebuggers{trepan}{symbols} = [qw[
118             DB
119             subs
120             eval_with_return
121             save
122             ]];
123              
124             ## Local Variables:
125             ## mode: cperl
126             ## mode: auto-fill
127             ## cperl-indent-level: 4
128             ## End: