In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/606adbbb49332176b659b2f31e923f3a5c3899ba?hp=ecf5217a6a878bcf597e222b6f82da64ef65ecf1>
- Log ----------------------------------------------------------------- commit 606adbbb49332176b659b2f31e923f3a5c3899ba Merge: ecf5217... 422c59bf... Author: Rafael Garcia-Suarez <[email protected]> Date: Sat Jun 6 14:18:56 2009 +0200 Merge commit 'leto/debugger_symbols' into blead commit 422c59bf485ce57586a2a1e15602d42cac4d2612 Author: Duke Leto <[email protected]> Date: Thu Jun 4 16:11:42 2009 -0700 Fix my comment about DB::sub and make it DB::DB M lib/perl5db.pl commit b468dcb6f9226d3227926224976100d835ba9dda Author: Duke Leto <[email protected]> Date: Thu Jun 4 01:22:46 2009 -0700 Bump version of perl5db.pl to 1.33, add changelog comments and fix a POD typo M lib/perl5db.pl commit f96342d4d75c8fb34f1848985bba33c57b699e85 Merge: 2b4f847... ff2f7ef... Author: Duke Leto <[email protected]> Date: Wed Jun 3 23:33:24 2009 -0700 Merge branch 'debugger_symbols' of github.com:leto/perl into debugger_symbols commit ff2f7ef032add258929ac5ef7e2cb3680b318700 Author: Duke Leto <[email protected]> Date: Wed Jun 3 13:29:14 2009 -0700 Add lib/perl5db/t/symbol-table-bug to the MANIFEST M MANIFEST commit af6d5e29619bcbab57bda9664186fbcbfbb24d6c Author: Duke Leto <[email protected]> Date: Wed Jun 3 12:28:08 2009 -0700 Fix shebang line and permissions of lib/perl5db.t M lib/perl5db.t commit c7ab0c82025d4ee9350d1b8806629c897a30f18e Author: Duke Leto <[email protected]> Date: Wed Jun 3 12:02:50 2009 -0700 Add the debugger script which tests for undefs in the symbol table A lib/perl5db/t/symbol-table-bug commit bc6438f27b8177f398dff639c69a23d6decfb59d Author: Duke Leto <[email protected]> Date: Wed Jun 3 11:40:35 2009 -0700 Fix bug introduced in 67924fd which put the key _< with an undefined value in the symbol table This patch makes sure that $filename is defined before setting the _<$filename symbol. It also adds a test which makes sure that *no* symbols have undefined values after loading perl5db.pl . M lib/perl5db.pl M lib/perl5db.t ----------------------------------------------------------------------- Summary of changes: MANIFEST | 1 + lib/perl5db.pl | 10 +++++++--- lib/perl5db.t | 10 ++++++++-- lib/perl5db/t/symbol-table-bug | 11 +++++++++++ 4 files changed, 27 insertions(+), 5 deletions(-) mode change 100644 => 100755 lib/perl5db.t create mode 100644 lib/perl5db/t/symbol-table-bug diff --git a/MANIFEST b/MANIFEST index b7c9341..c6806b5 100644 --- a/MANIFEST +++ b/MANIFEST @@ -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 b851212..03ef2a2 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 <[email protected]> +# + 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 old mode 100644 new mode 100755 index 67b5fda..e14cfd3 --- 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 0000000..6b5c0e4 --- /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"; + -- Perl5 Master Repository
