[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl5-porters
Subject:    Re: Perl 5.10.0 bugreport: wrong debugger interaction with 'n' single stepping and a panic
From:       "Joshua ben Jore" <twists () gmail ! com>
Date:       2008-09-14 23:02:36
Message-ID: dc5c751d0809141602w593ea839yf132374296483d9c () mail ! gmail ! com
[Download RAW message or body]

On Mon, Sep 8, 2008 at 2:08 PM, Heiko Eißfeldt <heiko@hexco.de> wrote:
> Heiko Eißfeldt wrote:
>
>> # grep OPERATOR
>> # works
>> print +(0 < scalar grep(sub { $_ == 9 }, (1..10))) ? "found\n" : "not
>> found\n";
>
> Oops, this was incorrect. The condition evaluates always to true.

To work within Perl 5 as it is right now, I suspect what you should do
is surpress the normal stopping points in dbstate nodes after seeing a
mapstart or grepstart and until the finalizing mapwhile/grepwhile has
chosen to exit its current loop or until the current scope is exited
abnormally by an exception. Probably the right way to solve this would
be to refactor the compiled code a bit so this detection is easier.

Or perhaps as you're at the preceding dbstate node, you'd start a new
local version of $^P which was "continue." You'd edit the linearly
next dbstate node and replace it with something which would reset $^P.
That way, $^P is set for linear execution and is cleaned up for
abnormal execution. I think I like the modifying code idea a bit more
since that's cleaner.

Josh

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic