Wonderful! That was just what I needed. Adding a DB::sub subroutine has fixed it.
Many thanks Bram! Tim. On Thu, Aug 06, 2009 at 03:13:52PM +0200, Bram wrote: > Citeren Tim Bunce <[email protected]>: > >> The problem is summarised here: >> http://code.google.com/p/perl-devel-nytprof/source/browse/trunk/gotobug/README >> >> The .../gotobug directory contains a very small test case that >> reproduces the problem. >> >> I'd appreciate any insight into the cause and/or how to workaround it. >> >> If I can't find a solution in the next few days then I'll bump the >> minimum perl version required for NYTProf to 5.8.8. I don't feel bad >> about that, but it would be nice to avoid it if possible. >> >> Tim. >> > > perl-5.8.7 seems to work as well. > > $ perl-5.8.6 test.pl > ok 1 > ok 2 > (eval) at E.pm line 5 > E::as_heavy() called at E.pm line 10 > require A.pm called at -e line 1 > Compilation failed in require at -e line 1. > not ok 3 > > $ perl-5.8.7 test.pl > ok 1 > ok 2 > ok 3 > > $ perl-5.8.8 test.pl > ok 1 > ok 2 > ok 3 > > > Doing a binary search: > > ----Program---- > #!/usr/bin/perl -l > > > my $do = "require A"; > > system("$^X -I/tmp/gotobug -e '$do'"); > if ($?) { print "not ok 1"; } > else { print "ok 1"; } > > $ENV{PERLDB_OPTS} = "NonStop"; > system("$^X -I/tmp/gotobug -d -e '$do'"); > if ($?) { print "not ok 2"; } > else { print "ok 2"; } > > system("$^X -I/tmp/gotobug -d:stub -e '$do'"); > if ($?) { print "not ok 3"; } > else { print "ok 3"; } > > > > ----Output of .../pecunDs/perl-5....@24264/bin/perl---- > ok 1 > ok 2 > (eval) at /tmp/gotobug/E.pm line 5 > E::as_heavy() called at /tmp/gotobug/E.pm line 10 > require A.pm called at -e line 1 > Compilation failed in require at -e line 1. > not ok 3 > > ----EOF ($?='0')---- > ----Output of .../pcejYPj/perl-5....@24265/bin/perl---- > ok 1 > ok 2 > ok 3 > > ----EOF ($?='0')---- > > > http://perl5.git.perl.org/perl.git/commit/f2a7f2982c10dbcfc2084d281af6ad8b959d5fb9 > > [perl #35059] [PATCH] caller() skips frames (such as eval() frames) if $^P set > From: [email protected] (via RT) > <[email protected]> > Message-Id: <[email protected]> > > improved version of change 21842 that copes with glob DB::sub > existing but &DB::sub not existing. > > p4raw-id: //depot/p...@24265 > > From the RT ticket: > > 'If the glob DB::sub exists but the subroutine &DB::sub does not, caller() can > get confused and skip certain frames -- especially frames created by eval. > This situation will occur if $^P is set and the debugger has not been loaded. > A patch is provided, including some test cases.' > > > > It did succeed in getting it to work on perl-5.8.6 (and on perl-5.6.0) but > I'm not . > > To get it working on I used for stub.pm: > > package Devel::stub; > > package DB; > sub DB {} > sub sub { > &$sub; > } > > 1; > __END__ > > ( goto ⊂ and eval { &$sub; } and eval { goto ⊂ }; work as well.) > > I'm not really familiar with the code of NYTProf: does it define DB::sub ? > (And/or is it possible to add it?) > > > Best regards, > > Bram > > --~--~---------~--~----~------------~-------~--~----~ You've received this message because you are subscribed to the Devel::NYTProf Development User group. Group hosted at: http://groups.google.com/group/develnytprof-dev Project hosted at: http://perl-devel-nytprof.googlecode.com CPAN distribution: http://search.cpan.org/dist/Devel-NYTProf To post, email: [email protected] To unsubscribe, email: [email protected] -~----------~----~----~----~------~----~------~--~---
