X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDB.pm;h=342f5d82ec1f234a19c18dc8f01fa4721cfdbabb;hb=78e38bb6033b96ad3fdd5f4f7bd08f6fedae70cb;hp=1395c81b5a7bdba5e2abc66210adb471156af0f6;hpb=43d8869b61f38e2bcba70315c30436a0b25ba2d5;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/DB.pm b/lib/DB.pm index 1395c81..342f5d8 100644 --- 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; } @@ -555,9 +564,9 @@ change) package CLIENT; use DB; @ISA = qw(DB); - + # these (inherited) methods can be called by the client - + CLIENT->register() # register a client package name CLIENT->done() # de-register from the debugging API CLIENT->skippkg('hide::hide') # ask DB not to stop in this package @@ -585,7 +594,7 @@ change) # These methods will be called at the appropriate times. # Stub versions provided do nothing. # None of these can block. - + CLIENT->init() # called when debug API inits itself CLIENT->stop(FILE,LINE) # when execution stops CLIENT->idle() # while stopped (can be a client event loop) @@ -794,7 +803,7 @@ highly experimental and subject to change. =head1 AUTHOR -Gurusamy Sarathy gsar@umich.edu +Gurusamy Sarathy gsar@activestate.com This code heavily adapted from an early version of perl5db.pl attributable to Larry Wall and the Perl Porters.