This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Test tweaks for VMS from Craig Berry.
[perl5.git] / lib / DB.pm
index 711acc0..342f5d8 100644 (file)
--- a/lib/DB.pm
+++ b/lib/DB.pm
@@ -93,6 +93,16 @@ sub DB {
 
   $usrctxt = "package $DB::package;";          # this won't let them modify, alas
   local(*DB::dbline) = "::_<$DB::filename";
+
+  # we need to check for pseudofiles on Mac OS (these are files
+  # not attached to a filename, but instead stored in Dev:Pseudo)
+  # since this is done late, $DB::filename will be "wrong" after
+  # skippkg
+  if ($^O eq 'MacOS' && $#DB::dbline < 0) {
+    $DB::filename = 'Dev:Pseudo';
+    *DB::dbline = "::_<$DB::filename";
+  }
+
   my ($stop, $action);
   if (($stop,$action) = split(/\0/,$DB::dbline{$DB::lineno})) {
     if ($stop eq '1') {
@@ -406,8 +416,7 @@ sub _find_subline {
   $name = "main" . $name if substr($name,0,2) eq "::";
   my($fname, $from, $to) = ($DB::sub{$name} =~ /^(.*):(\d+)-(\d+)$/);
   if ($from) {
-    # XXX this needs local()-ization of some sort
-    *DB::dbline = "::_<$fname";
+    local *DB::dbline = "::_<$fname";
     ++$from while $DB::dbline[$from] == 0 && $from < $to;
     return $from;
   }