From: Duke Leto Date: Wed, 3 Jun 2009 18:40:35 +0000 (-0700) Subject: Fix bug introduced in 67924fd which put the key _< with an undefined value in the... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bc6438f27b8177f398dff639c69a23d6decfb59d;p=p5sagit%2Fp5-mst-13.2.git 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 . --- diff --git a/lib/perl5db.pl b/lib/perl5db.pl index b851212..da29b9e 100644 --- a/lib/perl5db.pl +++ b/lib/perl5db.pl @@ -1054,7 +1054,7 @@ warn( # Do not ;-) if 0; foreach my $k (keys (%INC)) { - &share(\$main::{'_<'.$filename}); + &share(\$main::{'_<'.$filename}) if defined $filename; }; # Command-line + PERLLIB: diff --git a/lib/perl5db.t b/lib/perl5db.t index 67b5fda..b0d2949 100644 --- a/lib/perl5db.t +++ b/lib/perl5db.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 {