diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/perl5db.pl | 10 | ||||
-rwxr-xr-x[-rw-r--r--] | lib/perl5db.t | 10 | ||||
-rw-r--r-- | lib/perl5db/t/symbol-table-bug | 11 |
3 files changed, 26 insertions, 5 deletions
diff --git a/lib/perl5db.pl b/lib/perl5db.pl index b8512123a6..03ef2a2c6b 100644 --- a/lib/perl5db.pl +++ b/lib/perl5db.pl @@ -511,7 +511,7 @@ package DB; BEGIN {eval 'use IO::Handle'}; # Needed for flush only? breaks under miniperl # Debugger for Perl 5.00x; perl5db.pl patch level: -$VERSION = 1.32; +$VERSION = '1.33'; $header = "perl5db.pl version $VERSION"; @@ -949,6 +949,9 @@ sub eval { # + [perl #57016] debugger: o warn=0 die=0 ignored # + Note, but don't use, PERLDBf_SAVESRC # + Fix #7013: lvalue subs not working inside debugger +# Changes: 1.32: Jun 03, 2009 Jonathan Leto <jonathan@leto.net> +# + Fix bug where a key _< with undefined value was put into the symbol table +# + when the $filename variable is not set ######################################################################## =head1 DEBUGGER INITIALIZATION @@ -1053,8 +1056,9 @@ warn( # Do not ;-) ) if 0; +# without threads, $filename is not defined until DB::DB is called foreach my $k (keys (%INC)) { - &share(\$main::{'_<'.$filename}); + &share(\$main::{'_<'.$filename}) if defined $filename; }; # Command-line + PERLLIB: @@ -1846,7 +1850,7 @@ $I_m_init = 1; This gigantic subroutine is the heart of the debugger. Called before every statement, its job is to determine if a breakpoint has been reached, and stop if so; read commands from the user, parse them, and execute -them, and hen send execution off to the next statement. +them, and then send execution off to the next statement. Note that the order in which the commands are processed is very important; some commands earlier in the loop will actually alter the C<$cmd> variable diff --git a/lib/perl5db.t b/lib/perl5db.t index 67b5fda882..e14cfd30dd 100644..100755 --- a/lib/perl5db.t +++ b/lib/perl5db.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!./perl BEGIN { chdir 't' if -d 't'; @@ -26,7 +26,7 @@ my $dev_tty = '/dev/tty'; } } -plan(2); +plan(3); sub rc { open RC, ">", ".perldb" or die $!; @@ -82,6 +82,12 @@ like($contents, qr/sub factorial/, like($output, qr/foo is defined/, 'lvalue subs work in the debugger'); } +{ + local $ENV{PERLDB_OPTS} = "ReadLine=0 NonStop=1"; + my $output = runperl(switches => [ '-d' ], progfile => '../lib/perl5db/t/symbol-table-bug'); + like($output, qr/Undefined symbols 0/, 'there are no undefined values in the symbol table'); +} + # clean up. END { diff --git a/lib/perl5db/t/symbol-table-bug b/lib/perl5db/t/symbol-table-bug new file mode 100644 index 0000000000..6b5c0e45f0 --- /dev/null +++ b/lib/perl5db/t/symbol-table-bug @@ -0,0 +1,11 @@ +#!/usr/bin/perl +# +# This code is used by lib/perl5db.t !!! +# + +use strict; +no strict 'refs'; +my %main = %{*{"main\::"}} ; +my @undef_symbols = grep { !defined $main{$_} } (keys %main); +print 'Undefined symbols ', scalar(@undef_symbols) . "\n"; + |