From: Nicholas Clark Date: Tue, 2 Dec 2008 22:16:56 +0000 (+0000) Subject: Change PL_debug behaviour so that string eval lines are saved whenever X-Git-Tag: accepted/trunk/20130322.191538~12418 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb044b10917d0598b3201b68e4a5d3ba7d124ef3;p=platform%2Fupstream%2Fperl.git 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. p4raw-id: //depot/perl@34986 --- diff --git a/pp_ctl.c b/pp_ctl.c index 5096b3a..e9b4bfc 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -3739,7 +3739,9 @@ PP(pp_entereval) } 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); diff --git a/t/comp/retainedlines.t b/t/comp/retainedlines.t index bbf1e10..c66ad74 100644 --- a/t/comp/retainedlines.t +++ b/t/comp/retainedlines.t @@ -10,7 +10,7 @@ BEGIN { use strict; -plan (tests => 57); +plan (tests => 65); $^P = 0xA; @@ -67,11 +67,8 @@ for my $sep (' ', "\0") { 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++; }