diff options
-rw-r--r-- | lib/perl5db.t | 3 | ||||
-rw-r--r-- | pp_hot.c | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/lib/perl5db.t b/lib/perl5db.t index 22a8271c5e..fd65ef92e4 100644 --- a/lib/perl5db.t +++ b/lib/perl5db.t @@ -76,9 +76,8 @@ like($contents, qr/sub factorial/, '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'); } @@ -2774,7 +2774,14 @@ try_autoload: 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"); |