New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perl debugger dies #8764
Comments
From 1illig@informatik.uni-hamburg.deCreated by 1illig@rzdspc2.informatik.uni-hamburg.de$ echo 'print "hello\n";' > bug.pl Perl Info
|
From @jkeenanOn Wed Feb 07 06:06:40 2007, 1illig@informatik.uni-hamburg.de wrote:
This is still present in perl 5.14.2: [perl] 547 $ echo 'print "hello\n";' > bug.pl [perl] 549 $ env PERLDB_OPTS="noTTY frame=2" perl -d bug.pl Here's the relevant part of perl5db.pl: 5397 sub print_lineinfo { |
The RT System itself - Status changed from 'new' to 'open' |
From @jkeenanOn Sat Nov 12 07:12:13 2011, jkeenan wrote:
And still present in 5.18.0: $ env PERLDB_OPTS="noTTY frame=2" perl -d bug.pl |
From @shlomifOn Fri Aug 09 18:43:12 2013, jkeenan wrote:
Attached are: 1. A patch to fix the problem with a test. 2. Something that remove some code in lib/perl5db.t whose effect is You can also pull them from: https://github.com/shlomif/perl/tree/rt41461_perl_debugger_dies Note that the branch diverged from bleadperl, so the appropriate patches Regards, -- Shlomi Fish |
From @shlomif0001-Fix-RT-41461-with-a-test.patchFrom df2c5269b0f8ba0c20fcb7f0523eaabdba4ab495 Mon Sep 17 00:00:00 2001
From: Shlomi Fish <shlomif@shlomifish.org>
Date: Sat, 10 Aug 2013 10:21:16 +0300
Subject: [PATCH 1/2] Fix RT #41461 (with a test).
A problem with the perl debugger of writing to an undef $LINEINFO.
---
lib/perl5db.pl | 6 +++++-
lib/perl5db.t | 10 +++++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/lib/perl5db.pl b/lib/perl5db.pl
index 48ec301..9556e2d 100644
--- a/lib/perl5db.pl
+++ b/lib/perl5db.pl
@@ -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<postponed_sub>
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.4
|
From @shlomif0002-Remove-some-effect-less-code.patchFrom c82f0459245574d4836678b41637c457f68d3c0b Mon Sep 17 00:00:00 2001
From: Shlomi Fish <shlomif@shlomifish.org>
Date: Sat, 10 Aug 2013 10:24:00 +0300
Subject: [PATCH 2/2] Remove some effect-less code.
---
lib/perl5db.t | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/lib/perl5db.t b/lib/perl5db.t
index 09a8655..d805936 100644
--- a/lib/perl5db.t
+++ b/lib/perl5db.t
@@ -117,21 +117,6 @@ EOF
like( $output, 'success' , '[perl #41461] code is run' );
}
-{
- rc(<<'EOF');
-&parse_options("NonStop=0 TTY=db.out LineInfo=db.out");
-
-sub afterinit {
- push (@DB::typeahead,
- 't 2',
- 'c',
- 'q',
- );
-
-}
-EOF
-}
-
package DebugWrap;
sub new {
--
1.8.3.4
|
From @jkeenanOn Sat Aug 10 00:53:29 2013, shlomif wrote:
Thanks for the patches. I applied the first patch in commit aa8c2dc $ echo 'print "hello\n";' > bug.pl Could you say a bit more about why the code being deleted in the second Thank you very much. |
From @shlomifHi James, On Sat Aug 10 06:34:19 2013, jkeenan wrote:
Thanks!
Sure: one should call rc() in lib/perl5db.t to initialise a Hope it is clearer now. Regards, -- Shlomi Fish |
From @jkeenanOn Sat Aug 10 07:05:03 2013, shlomif wrote:
Thank you very much. Applied in commit 1a066ce. Resolving ticket. |
@jkeenan - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#41461 (status was 'resolved')
Searchable as RT41461$
The text was updated successfully, but these errors were encountered: