Change 34986 by [EMAIL PROTECTED] on 2008/12/02 22:16:56
Change PL_debug behaviour so that string eval lines are saved whenever
a subroutine is defined, even if the eval'd string has subsequent
syntax errors. This allows the debugger to single step into these
subroutines.
Affected files ...
... //depot/perl/pp_ctl.c#721 edit
... //depot/perl/t/comp/retainedlines.t#7 edit
Differences ...
==== //depot/perl/pp_ctl.c#721 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#720~34985~ 2008-12-02 12:43:58.000000000 -0800
+++ perl/pp_ctl.c 2008-12-02 14:16:56.000000000 -0800
@@ -3739,7 +3739,9 @@
} else {
/* We have already left the scope set up earler thanks to the LEAVE
in doeval(). */
- if (PERLDB_SAVESRC_INVALID) {
+ if (was != PL_breakable_sub_gen /* Some subs defined here. */
+ ? (PERLDB_LINE || PERLDB_SAVESRC)
+ : PERLDB_SAVESRC_INVALID) {
/* Retain the filegv we created. */
} else {
(void)hv_delete(PL_defstash, tmpbuf, len, G_DISCARD);
==== //depot/perl/t/comp/retainedlines.t#7 (text) ====
Index: perl/t/comp/retainedlines.t
--- perl/t/comp/retainedlines.t#6~34985~ 2008-12-02 12:43:58.000000000
-0800
+++ perl/t/comp/retainedlines.t 2008-12-02 14:16:56.000000000 -0800
@@ -10,7 +10,7 @@
use strict;
-plan (tests => 57);
+plan (tests => 65);
$^P = 0xA;
@@ -67,11 +67,8 @@
is (eval "$name()", "This is $name", "Subroutine was compiled, despite
error")
or diag $@;
- my @after = grep { /eval/ } keys %::;
-
- is (@after, 0 + keys %seen,
- "current behaviour is that errors in eval trump subroutine definitions");
-
+ check_retained_lines($prog,
+ 'eval that defines subroutine but has syntax error');
$name++;
}
End of Patch.