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 .
if 0;
foreach my $k (keys (%INC)) {
- &share(\$main::{'_<'.$filename});
+ &share(\$main::{'_<'.$filename}) if defined $filename;
};
# Command-line + PERLLIB:
}
}
-plan(2);
+plan(3);
sub rc {
open RC, ">", ".perldb" or die $!;
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 {