Off by one error on breakpoints in combination with for loops and comments
Created by: syskrank
Godot version:
Godot 3.1 b376273, debug & release_debug builds
OS/device including version: Linux Mint 19 x64
Issue description:
When outputting messages via print() in nested for cycles, not all lines are being outputted if a breakpoint is set AFTER the corresponding output code:
The code above with breakpoint set outputs only 5 lines of messages instead of expected 8. So it seems that the second cycle didn't finish it's whole set of iterations.
This is valid for engine output pane and command line terminal as well. And such behavior is quite misleading and could have some deeper roots in debugger/gdscirp behavior (???).
Interesting detail, though, is that if one puts additional print statement before the breakpoint, all prior calls became valid, including the new one. ( See the commented print() before the pass)
Also, not only the breakpoints set on pass are displaying this behavior, but the ones in more complex code examples do as well.
Steps to reproduce:
Write two nested cycles with print output in each.
Set a breakpoint after the second cycle.
Run project in the debug mode.
See that not all of the expected output is present in corresponding editor pane and in the command line terminal.
Minimal reproduction project: godot_double_cycle.zip
