DB-Hooks
view release on metacpan or search on metacpan
lib/DB/Hooks.pm view on Meta::CPAN
# checks here
return @_>1 ? $DB::state[-1]{ ddd } = $value : $DB::state[-1] && $DB::state[-1]{ ddd } // 0
if $name eq 'ddd';
my $hash = $DB::state[$DB::instance];
my $ddd = $hash->{ ddd } // 0;
# Track changes to DB::state OR reads from DB::state
if( $ddd&4 && @_>1 || $ddd&8 && @_<=1 ) {
my( $sub ) = (caller(1))[3];
my( $file, $line ) = (caller)[1,2];
my $old_value = vis_undef( $hash->{ $name } );
my $new_value = @_ > 1 ? ' -> ' .vis_undef( $value ) : '';
DB::say "Access from $sub ($file:$line) to "
.DB::_c( $name, 36 ) ." state($DB::instance): "
.DB::_c( "$old_value$new_value", '3;37' )
}
return $hash->{ $name } unless @_ > 1;
delete $hash->{ $name }, return unless defined $value;
lib/DB/Hooks.pm view on Meta::CPAN
for( qw/ ddd dd trace TraceLoad TraceGoto TraceCall TraceStack TraceReturn / ) {
DB::state( $_ => $DB::options{ "${ct}$_" } );
}
# When we are going to work at white_box we must activate black_box
# because white_box can be activated only from black_box (see DB::sub)
if( $DB::options{ "${ct}white_box" } ) {
DB::state( black_box_active => 1 );
}
# We may check if (caller)[3] eq 'import' to distinguish CT and RT
$^P &= ~0x20 if $DB::options{ NonStop };
DB::state( 'single', 1 ) if $DB::options{ Stop }; # IT: commit:1191c38
}
sub _leave {
my $class = shift;
# Now debugger and all required modules are loaded (except Descendant).
( run in 2.438 seconds using v1.01-cache-2.11-cpan-ad19def0cd9 )