From aa8c2dcb5a098416ce30bf30f65ded786b2f7b65 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Sat, 10 Aug 2013 10:21:16 +0300 Subject: [PATCH] Fix RT #41461 (with a test). A problem with the perl debugger of writing to an undef $LINEINFO. Bump $VERSION to 1.42. For: RT #41461 --- lib/perl5db.pl | 8 ++++++-- lib/perl5db.t | 10 +++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/perl5db.pl b/lib/perl5db.pl index 48ec301..ab82616 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.41'; +$VERSION = '1.42'; $header = "perl5db.pl version $VERSION"; @@ -6143,7 +6143,11 @@ sub print_lineinfo { resetterm(1) if $LINEINFO eq $OUT and $term_pid != $$; local $\ = ''; local $, = ''; - print $LINEINFO @_; + # $LINEINFO may be undef if $noTTY is set or some other issue. + if ($LINEINFO) + { + print {$LINEINFO} @_; + } } ## end sub print_lineinfo =head2 C diff --git a/lib/perl5db.t b/lib/perl5db.t index 26b0581..09a8655 100644 --- a/lib/perl5db.t +++ b/lib/perl5db.t @@ -29,7 +29,7 @@ BEGIN { $ENV{PERL_RL} = 'Perl'; # Suppress system Term::ReadLine::Gnu } -plan(117); +plan(119); my $rc_filename = '.perldb'; @@ -108,6 +108,14 @@ EOF is( $?, 0, '[perl #116771] autotrace does not crash debugger, exit == 0' ); like( $output, 'success' , '[perl #116771] code is run' ); } +# [ perl #41461] Frame=2 noTTY +{ + local $ENV{PERLDB_OPTS} = "frame=2 noTTY nonstop"; + rc(''); + my $output = runperl( switches => [ '-d' ], prog => 'print q{success}' ); + is( $?, 0, '[perl #41461] frame=2 noTTY does not crash debugger, exit == 0' ); + like( $output, 'success' , '[perl #41461] code is run' ); +} { rc(<<'EOF'); -- 1.8.3.1