Change 34833 by [EMAIL PROTECTED] on 2008/11/14 14:29:53
Subject: [perl #48489] patch to fix perl bug #7013
From: "bharanee rathna" (via RT) <[EMAIL PROTECTED]>
Date: Tue, 11 Dec 2007 15:25:21 -0800
Message-ID: <[EMAIL PROTECTED]>
Just the pp_hot.c portion of this patch applied along with removing
the TODO from the test added in the previous change.
Affected files ...
... //depot/perl/lib/perl5db.t#9 edit
... //depot/perl/pp_hot.c#592 edit
Differences ...
==== //depot/perl/lib/perl5db.t#9 (text) ====
Index: perl/lib/perl5db.t
--- perl/lib/perl5db.t#8~34832~ 2008-11-14 06:18:00.000000000 -0800
+++ perl/lib/perl5db.t 2008-11-14 06:29:53.000000000 -0800
@@ -76,9 +76,8 @@
'The ${main::_<filename} variable in the debugger was not destroyed'
);
-TODO: {
+{
local $ENV{PERLDB_OPTS} = "ReadLine=0";
- local $::TODO = "lvalueness isn't propagated in the debugger";
my $output = runperl(switches => [ '-d' ], progfile =>
'../lib/perl5db/t/lvalue-bug');
like($output, qr/foo is defined/, 'lvalue subs work in the debugger');
}
==== //depot/perl/pp_hot.c#592 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c#591~34831~ 2008-11-14 04:37:01.000000000 -0800
+++ perl/pp_hot.c 2008-11-14 06:29:53.000000000 -0800
@@ -2774,7 +2774,14 @@
Perl_get_db_sub(aTHX_ &sv, cv);
if (CvISXSUB(cv))
PL_curcopdb = PL_curcop;
- cv = GvCV(PL_DBsub);
+ if (CvLVALUE(cv)) {
+ /* check for lsub that handles lvalue subroutines */
+ cv = GvCV(gv_HVadd(gv_fetchpv("DB::lsub", GV_ADDMULTI, SVt_PVHV)));
+ /* if lsub not found then fall back to DB::sub */
+ if (!cv) cv = GvCV(PL_DBsub);
+ } else {
+ cv = GvCV(PL_DBsub);
+ }
if (!cv || (!CvXSUB(cv) && !CvSTART(cv)))
DIE(aTHX_ "No DB::sub routine defined");
End of Patch.