$subrange = pop @pieces;
$file = join(':', @pieces);
if ($file ne $filename) {
+ print $OUT "Switching to file '$file'.\n"
+ unless $emacs;
*dbline = $main::{'_<' . $file};
$max = $#dbline;
$filename = $file;
($file,$i) = (find_sub($subname) =~ /^(.*):(.*)$/);
$i += 0;
if ($i) {
- $filename = $file;
- *dbline = $main::{'_<' . $filename};
+ local $filename = $file;
+ local *dbline = $main::{'_<' . $filename};
$had_breakpoints{$filename} = 1;
$max = $#dbline;
++$i while $dbline[$i] == 0 && $i < $max;
$cmd =~ /^c\b\s*([\w:]*)\s*$/ && do {
end_report(), next CMD if $finished and $level <= 1;
$subname = $i = $1;
+ # Probably not needed, since we finish an interactive
+ # sub-session anyway...
+ # local $filename = $filename;
+ # local *dbline = *dbline; # XXX Would this work?!
if ($i =~ /\D/) { # subroutine name
$subname = $package."::".$subname
unless $subname =~ /::/;
B<-> List previous window of lines.
B<w> [I<line>] List window around I<line>.
B<.> Return to the executed line.
-B<f> I<filename> Switch to viewing I<filename>. Must be loaded.
+B<f> I<filename> Switch to viewing I<filename>. File must be already loaded.
+ I<filename> may be either the full name of the file, or a regular
+ expression matching the full file name:
+ B<f> I</home/me/foo.pl> and B<f> I<oo\\.> may access the same file.
+ Evals (with saved bodies) are considered to be filenames:
+ B<f> I<(eval 7)> and B<f> I<eval 7\\b> access the body of the 7th eval
+ (in the order of execution).
B</>I<pattern>B</> Search forwards for I<pattern>; final B</> is optional.
B<?>I<pattern>B<?> Search backwards for I<pattern>; final B<?> is optional.
B<L> List all breakpoints and actions.
is not a full filename as found in values of %INC, it is considered as
a regexp.
+C<eval>ed strings (when accessible) are considered to be filenames:
+C<f (eval 7)> and C<f eval 7\b> access the body of the 7th C<eval>ed string
+(in the order of execution). The bodies of currently executed C<eval>
+and of C<eval>ed strings which define subroutines are saved, thus are
+accessible by this mechanism.
+
=item /pattern/
Search forwards for pattern; final / is optional.