Camelcade / Devel-Camelcadedb

Perl module for debugging with Perl5 plugin for IntelliJ
Other
23 stars 9 forks source link

Infinite loop when keyword 'each' used in while condition #19

Closed mominshahab closed 8 years ago

mominshahab commented 8 years ago

When the following code is run in the debugger , line by line, it gets stuck in infinite loop. The code runs fine without debugger.

my %hash = ('Hello' => 'World');
while ( my ( $key, $value ) = each %hash ) {
    print "\n$key=$value";
}

The code above can be used to reproduce the issue.

Perl version: 5.18.2 built for MSWin32-x86-multi-thread-64int Deval::Camelcadedb version: 1.6.1.2 InteliJ IDEA version 2016.1.3 Perl Plugin version 2.005

hurricup commented 8 years ago

Seems something resets %hash iterator when it steps inside the debugger. I've disabled suspected methods in it but it didn't helped. Will need to investigate. For now you may use alternatives way of iteration.

hurricup commented 8 years ago

Upd, aside of keys and vals, copying hash via %other_hash = %hash resets iterator too :(

hurricup commented 8 years ago

You may checkout this repo and run perl Makefile.PL && make install or dmake if you are on windows. Should work fine now. Thank you for reporting this issue.