From 931d943835db379bfdca349cb29b11fd4f0a90e7 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Sun, 30 Sep 2012 19:11:02 +0200 Subject: [PATCH] Extract _DB__handle_watch_expressions() . --- lib/perl5db.pl | 57 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/lib/perl5db.pl b/lib/perl5db.pl index a17ebde..1fe1f8f 100644 --- a/lib/perl5db.pl +++ b/lib/perl5db.pl @@ -523,7 +523,7 @@ BEGIN { # Debugger for Perl 5.00x; perl5db.pl patch level: use vars qw($VERSION $header); -$VERSION = '1.39_04'; +$VERSION = '1.39_05'; $header = "perl5db.pl version $VERSION"; @@ -1827,6 +1827,36 @@ sub _DB__determine_if_we_should_break } ## end if ($dbline{$line} && ... } +sub _DB__handle_watch_expressions +{ + if ( $trace & 2 ) { + for my $n (0 .. $#to_watch) { + $evalarg = $to_watch[$n]; + local $onetimeDump; # Tell DB::eval() to not output results + + # Fix context DB::eval() wants to return an array, but + # we need a scalar here. + my ($val) = join( "', '", &eval ); + $val = ( ( defined $val ) ? "'$val'" : 'undef' ); + + # Did it change? + if ( $val ne $old_watch[$n] ) { + + # Yep! Show the difference, and fake an interrupt. + $signal = 1; + print $OUT < -- 2.7.4