#else
sv_setpvn(GvSV(gv), name, namelen);
#endif
- if (PERLDB_LINE || PERLDB_SAVESRC)
- hv_magic(GvHVn(gv_AVadd(gv)), NULL, PERL_MAGIC_dbfile);
}
+ if ((PERLDB_LINE || PERLDB_SAVESRC) && !GvAV(gv))
+ hv_magic(GvHVn(gv_AVadd(gv)), NULL, PERL_MAGIC_dbfile);
if (tmpbuf != smallbuf)
Safefree(tmpbuf);
return gv;
within a C<UNITCHECK> block no longer causes the interpreter to crash
L<[perl #70614]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=70614>.
+=item *
+
+When C<-d> is used on the shebang (C<#!>) line, the debugger now has access
+to the lines of the main program. In the past, this sometimes worked and
+sometimes did not, depending on what order things happened to be arranged
+in memory.
+
=back
=head1 Known Problems
# This test depends on t/lib/Devel/switchd.pm.
-plan(tests => 2);
+plan(tests => 3);
my $r;
like($r, qr/^sub<Devel::switchd::import>;import<Devel::switchd a 42>;DB<main,$::tempfile_regexp,9>;sub<Foo::foo>;DB<Foo,$::tempfile_regexp,5>;DB<Foo,$::tempfile_regexp,6>;DB<Foo,$::tempfile_regexp,6>;sub<Bar::bar>;DB<Bar,$::tempfile_regexp,2>;sub<Bar::bar>;DB<Bar,$::tempfile_regexp,2>;sub<Bar::bar>;DB<Bar,$::tempfile_regexp,2>;$/);
}
+# [perl #71806]
+cmp_ok(
+ runperl( # less is useful for something :-)
+ switches => [ '"-Mless ++INC->{q-Devel/_.pm-}"' ],
+ progs => [
+ '#!perl -d:_',
+ 'sub DB::DB{} print scalar @{q/_</.__FILE__}',
+ ],
+ ),
+ '>',
+ 0,
+ 'The debugger can see the lines of the main program under #!perl -d',
+);