Re: Apparent bugs in various things

Chip Salzenberg (chip@atlantic.net)
Fri, 21 Mar 1997 00:07:35 -0500 (EST)


According to Tom Christiansen:
> Use of uninitialized value at /usr/lib/perl/perl5db.pl line 1188.

I'm not sure I've sent this patch to the list, but it will be in _94.
It should fix the "undefined" problems with the debugger.

Index: lib/perl5db.pl
***************
*** 3,7 ****
  # Debugger for Perl 5.00x; perl5db.pl patch level:
  
! $VERSION = 0.9907;
  $header = "perl5db.pl patch level $VERSION";
  
--- 3,7 ----
  # Debugger for Perl 5.00x; perl5db.pl patch level:
  
! $VERSION = 0.9908;
  $header = "perl5db.pl patch level $VERSION";
  
***************
*** 262,266 ****
    my @had_breakpoints= get_list("PERLDB_VISITED");
    for (0 .. $#had_breakpoints) {
!     %{$postponed_file{$had_breakpoints[$_]}} = get_list("PERLDB_FILE_$_");
    }
    my %opt = get_list("PERLDB_OPT");
--- 262,267 ----
    my @had_breakpoints= get_list("PERLDB_VISITED");
    for (0 .. $#had_breakpoints) {
!     my %pf = get_list("PERLDB_FILE_$_");
!     $postponed_file{$had_breakpoints[$_]} = \%pf if %pf;
    }
    my %opt = get_list("PERLDB_OPT");
***************
*** 650,659 ****
  			my ($file, $line);
  			for $file (keys %postponed_file) {
! 			  my %db = %{$postponed_file{$file}};
! 			  next unless keys %db;
  			  print $OUT " $file:\n";
! 			  for $line (sort {$a <=> $b} keys %db) {
  				print $OUT "  $line:\n";
! 				my ($stop,$action) = split(/\0/, $db{$line});
  				print $OUT "    break if (", $stop, ")\n"
  				  if $stop;
--- 651,659 ----
  			my ($file, $line);
  			for $file (keys %postponed_file) {
! 			  my $db = $postponed_file{$file};
  			  print $OUT " $file:\n";
! 			  for $line (sort {$a <=> $b} keys %$db) {
  				print $OUT "  $line:\n";
! 				my ($stop,$action) = split(/\0/, $$db{$line});
  				print $OUT "    break if (", $stop, ")\n"
  				  if $stop;
***************
*** 856,865 ****
  			  my $file = $had_breakpoints[$_];
  			  *dbline = $main::{'_<' . $file};
! 			  next unless %dbline or %{$postponed_file{$file}};
  			  (push @hard, $file), next 
  			    if $file =~ /^\(eval \d+\)$/;
  			  my @add;
  			  @add = %{$postponed_file{$file}}
! 			    if %{$postponed_file{$file}};
  			  set_list("PERLDB_FILE_$_", %dbline, @add);
  			}
--- 856,865 ----
  			  my $file = $had_breakpoints[$_];
  			  *dbline = $main::{'_<' . $file};
! 			  next unless %dbline or $postponed_file{$file};
  			  (push @hard, $file), next 
  			    if $file =~ /^\(eval \d+\)$/;
  			  my @add;
  			  @add = %{$postponed_file{$file}}
! 			    if $postponed_file{$file};
  			  set_list("PERLDB_FILE_$_", %dbline, @add);
  			}
***************
*** 1186,1190 ****
      if $break_on_load{$filename};
    print $LINEINFO ' ' x $#stack, "Package $filename.\n" if $frame;
!   return unless %{$postponed_file{$filename}};
    $had_breakpoints{$filename}++;
    #%dbline = %{$postponed_file{$filename}}; # Cannot be done: unsufficient magic
--- 1186,1190 ----
      if $break_on_load{$filename};
    print $LINEINFO ' ' x $#stack, "Package $filename.\n" if $frame;
!   return unless $postponed_file{$filename};
    $had_breakpoints{$filename}++;
    #%dbline = %{$postponed_file{$filename}}; # Cannot be done: unsufficient magic
***************
*** 1193,1197 ****
      $dbline{$key} = $ {$postponed_file{$filename}}{$key};
    }
!   undef %{$postponed_file{$filename}};
  }
  
--- 1193,1197 ----
      $dbline{$key} = $ {$postponed_file{$filename}}{$key};
    }
!   delete $postponed_file{$filename};
  }
  

-- 
Chip Salzenberg          - a.k.a. -          <chip@atlantic.net>
 "Vacation time.  Families travel east, west, north, or south."
 "Some just burrow straight down." -- Crow T. Robot   // MST3K