Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Shlomi Fish (918)

Shlomi Fish
AOL IM: ShlomiFish (Add Buddy, Send Message)
Yahoo! ID: shlomif2 (Add User, Send Message)

I'm a hacker of Perl, C, Shell, and occasionally other languages. Perl is my favourite language by far. I'm a member of the Israeli Perl Mongers, and contribute to and advocate open-source technologies. Technorati Profile []

Journal of Shlomi Fish (918)

Tuesday November 14, 2006
10:50 AM

A Perl Debugger Bug and Its Resolution

[ #31605 ]

One bug that kept annoying me with the perl debugger, was that sometimes in the middle of debugging a program, the content of the current line stopped appearing. Recently, I was able to reproduce it with an XML::RSS test file, and decided to investigate.

I delved into the debugger internals and found that it gets the contents of the file from a variable called @{main::_<} (which as I found out was populated for it by the perl interpreter). And as it turned out, by printing this value within the debugger after I reproduced the problem, I got a small number of completely different lines. I searched for them in the perl source tree, and found they belonged inside an eval "" call in a Test::Builder function. And as I saw this eval call had a #line directive. And writing a short program which did an eval with such a line as its filename reproduced the bug in a self-contained form.

So I reported this bug. I eventually found out (by grepping the perl 5 source) that it was caused by some code that was added to toke.c between perl 5.8.7 and perl 5.8.8, and which was disabled in a Perl using ithreads support. Then RGS fixed the bug (at least in bleadperl now).

But he didn't add a regression test. Since I had an idea for writing such a test, I wrote one and sent it along. It still is not ready for inclusion into the perl 5 core, because it does not follow the conventions of the tests there. But it's a start.

Happy debugging!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.