in reply to Komodo IDE debug gets stuck in while loop when single stepping through

Is this a bug? If so, is it a known bug?

No, this is not a bug, it is a loop, and it is known that loops loop :)

I believe those komodo menu entries correspond to these two perldebug commands

 s [expr]    Single step [in expr] will loop in loops

 n [expr]    Next, steps over subs will loop in loops

If so, is there a known solution?

Yes, use  c [ln|sub]  Continue until position to skip the loop.

Here is a sample session

$ cat perldebug.loop.pl #!/usr/bin/perl -- my %f = ( 1 .. 10 ); while(my($k,$v)=each%f){ print qq[$k $v\n]; } print "done\n"; $ perl -d perldebug.loop.pl Loading DB routines from perl5db.pl version 1.33 Editor support available. Enter h or `h h' for help, or `perldoc perldebug' for more help. main::(perldebug.loop.pl:2): my %f = ( 1 .. 10 ); DB<1> n main::(perldebug.loop.pl:3): while(my($k,$v)=each%f){ DB<1> n main::(perldebug.loop.pl:4): print qq[$k $v\n]; DB<1> n 1 2 main::(perldebug.loop.pl:4): print qq[$k $v\n]; DB<1> s 3 4 main::(perldebug.loop.pl:4): print qq[$k $v\n]; DB<1> v 1 #!/usr/bin/perl -- 2: my %f = ( 1 .. 10 ); 3: while(my($k,$v)=each%f){ 4==> print qq[$k $v\n]; 5 } 6: print "done\n"; DB<1> c 5 Line 5 not breakable. DB<2> c 6 7 8 9 10 5 6 main::(perldebug.loop.pl:6): print "done\n"; DB<3> q

Replies are listed 'Best First'.
Re^2: Komodo IDE debug gets stuck in while loop when single stepping through
by Anonymous Monk on Jul 09, 2011 at 16:45 UTC

    I don't follow what you've done there... I don't want to skip the loop, I'd like the step by step debugging process to follow the script like it does when it runs through the whole thing, as would be logical. Is there any way to do this?

      I don't follow what you've done there...

      What are you confused by the "$ " or "cat"? "$ " is like C:\> and cat is like type -- its a shell (cmd.exe) session , you should try it yourself

      I don't want to skip the loop, I'd like the step by step debugging process to follow the script like it does when it runs through the whole thing, as would be logical. Is there any way to do this?

      Wait a minute, I missed something :) Are you sure the key/value pairs are always the same? Maybe there is whitespace or \r ...

      Is %thishash tied?

      Which version of komodo are you using? Try http://community.activestate.com/forums/komodo/komodo-support

Re^2: Komodo IDE debug gets stuck in while loop when single stepping through
by HelenCr (Monk) on Jun 01, 2012 at 10:18 UTC

    Guys, I have encountered the same problem, both in Padre and in EPIC on Eclipse. To put in succinctly: when single-stepping through a "while - each -hash" loop:

    while ( ($key, $value) = each %hash ) { print "$key => $value\n"; }
    the debugger gets into an infinite loop, and does not advance the iterator. I found out that this problem has been already mentioned here (in 2006): using-each-hash-debug

    Has anyone found a fix? I am researching it.

      Guys, I have encountered the same problem ...

      I doubt it

      The bug report is marked as resolved