diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-06-06 14:18:56 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-06-06 14:18:56 +0200 |
commit | 606adbbb49332176b659b2f31e923f3a5c3899ba (patch) | |
tree | 875a26ff41a289284a2098f58fb4b011a2d6c2ac | |
parent | ecf5217a6a878bcf597e222b6f82da64ef65ecf1 (diff) | |
parent | 422c59bf485ce57586a2a1e15602d42cac4d2612 (diff) | |
download | perl-606adbbb49332176b659b2f31e923f3a5c3899ba.tar.gz |
Merge commit 'leto/debugger_symbols' into blead
-rw-r--r-- | MANIFEST | 1 | ||||
-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 |
4 files changed, 27 insertions, 5 deletions
@@ -2760,6 +2760,7 @@ lib/perl5db.pl Perl debugging routines lib/perl5db.t Tests for the Perl debugger lib/perl5db/t/eval-line-bug Tests for the Perl debugger lib/perl5db/t/lvalue-bug Tests for the Perl debugger +lib/perl5db/t/symbol-table-bug Tests for the Perl debugger lib/PerlIO.pm PerlIO support module lib/PerlIO/via/QuotedPrint.pm PerlIO::via::QuotedPrint lib/PerlIO/via/t/QuotedPrint.t PerlIO::via::QuotedPrint 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"; + |