Hi Chris: I noticed that the most recent perl (5.12.2) mentions that there is a bug fix regarding lvalue subs in the debugger. I'm hoping this will solve the problem, but I'm still having troubles getting it installed. Once I figure this install problem out, I'll let you know if it fixes the lvalue sub debugging problem.
Regards, Doug [email protected] Software Engineer UCAR - COSMIC, Tel. (303) 497-2611 On Sat, 30 Oct 2010, Chris Marshall wrote: > On 10/29/2010 2:20 PM, Doug Hunt wrote: >> Hi all: Since I upgraded to perl 5.10.1, I've been having an annoying >> trouble with debugging lvalue subs in PDL. >> >> When I run across such a subroutine in the debugger, I cannot step over it >> with 'n', I am forced to step into it, as if I had typed 's'. >> >> So if I run this script with perl -d >> >> use PDL; >> $a = sequence(10); >> $b = $a->nslice([0,4]); >> print $b; >> >> the third line takes me on a long tour through PDL::nslice before allowing >> me to the 'print $b' line. >> >> One long scripts that make extensive use of slicing, this can be a real >> headache! > > Yes, I've noticed this as well. Did not understand > what the origin was. > >> After some experimentation, it seems that: >> >> 1) This only happens with pure-perl lvalue subs. These are the subs >> listed in 'Lvalue.pm' which are not implemented directly in PP (like >> index). >> >> 2) If I comment out 'use Lvalue;' in PDL.pm, the problem with the debugger >> goes away. The problem is that then the subs cannot be used as lvalues, >> so: >> >> $a->nslice([0,4]) .= 7; >> >> fails with: >> >> Can't modify non-lvalue subroutine call at >> /home/cosmicops/src_doug/test_pdl_debug.pl line 17. >> at /home/cosmicops/src_doug/test_pdl_debug.pl line 17 >> >> In this case I can instead use: >> >> (my $tmp = $a->nslice([0,4])) .= 7; >> >> but that is ugly and breaks a lot of existing code. >> >> Does anyone have any ideas (or fixes!) for this problem? > > Unfortunately, this problem (sf.net bug #2995500) is a > known problem with perl more recent than 5.10.0. I hacked > in the (my $tmp = func()) .= xxx workaround into the PDL > sources so at least the debugger would work for that. > > It is very difficult to keep the issue visible since > there is no automated way to show that it is still a > *big* problem. If there were some what to add an "under > the debugger" test to the PDL test suite, I think we > would have better luck with the problem since we could > say "here, this is what fails" to the perl developers. > > I've seen no further action since it was decided that > the problem was not a blocker to the 5.12 release.... > I wish it had been. > > --Chris > >> Thanks much, >> >> Doug > > _______________________________________________ > Perldl mailing list > [email protected] > http://mailman.jach.hawaii.edu/mailman/listinfo/perldl > _______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
