aaronelliotross has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

So here I am happily using the perl debugger, n'ing may way through a file of tests, when bam! the debugger stops printing out the lines from the file.

I still get prompts and I can still interact with the debugger. But it stops printing out the context. Neither . nor - nor l show anything.

Sorry, but I don't have a simple test case yet. I'm hoping someone will point me to the bug or conflict or whatever that I'm running into. :)

This is perl, v5.8.8 built for i386-linux

Here's a simple example:

DB<1> n main::(t/petition/quick.t:31): is( $id, $user->id(), "Returned user i +d matches id" ); + DB<1> n ok 3 - Returned user id matches id main::(t/petition/quick.t:33):

line 33 is actually:

"my %lists = map { $_->id() => 1 } $user->lists();"

Thanks in advance,

Aaron

Replies are listed 'Best First'.
Re: Perl Debugger Goes Silent
by perrin (Chancellor) on Jul 18, 2007 at 16:58 UTC
    Possibly a case of the debugger not being loaded when this stuff was compiled? You can look at the recent thread on how to turn on the debugger at run time for techniques to try.
Re: Perl Debugger Goes Silent
by tye (Sage) on Jul 18, 2007 at 19:59 UTC

    I think I've only seen that when doing string eval. That seems unlikely to have been the case in the example you described above, however.

    The debugger stuffs source code into places where you can examine it so you could use that information to try to better figure out what is going wrong:

    DB<1> x sort grep /^_</, keys %main:: ... DB<2> x @{"main::_<t/petition/quick.t"}

    - tye        

      tye, you rock.

      Turns out that there's a string eval in Test::Builder that is triggering the problem. Not just a string eval, a string eval that has a '#line' directive in it!

      In my version (0.7) it's at line 710:

      # Yes, it has to look like this or 5.4.5 won't see the #line directive +. # Don't ask me, man, I just work here. $test = eval " $code" . "\$got $type \$expect;";

      $code has something like "#line 31 t/petition/quick.t" in it. Removing $code from the string eval solves the problem.

      Fascinatingly, the Test::Builder code still reports the error at the right line. I wonder why and when it's necessary.

      What's up with string evals and #line in perl 5.8.8?

      Aaron