Odd debugger behaviour using breakpoint ignore count

31 views
Skip to first unread message

pjinturin

unread,
Mar 6, 2025, 1:44:12 PMMar 6
to PyScripter
I think there's something strange going on with the new breakpoint count feature. Consider the following code:

def fn(x):
    print(x)

for j in range(1000):
    pass
    fn(j)

If you put a breakpoint (breakpoint no.1) with an ignore count of 100 on "fn(j)" and run the debugger, execution stops when j=100. But if you then add an unconditional breakpoint (breakpoint no.2) on "pass" and continue execution the second breakpoint is ignored and it stops on breakpoint 1 when j=201. If I then press the F8 button (when I would expect execution to step to the for statement) it again stops on breakpoint 1, ignoring breakpoint 2, but this time j=202 (so ignoring the count condition). The only one of the debugger stepping functions that works is F7, which enters fn() and stops on the print statement. After this the debugger behaviour returns to what I would expect, until the next time that the breakpoint count is hit, when the odd behaviour starts again.

Am I missing something? Is this expected behaviour?
Thanks
Piero

PyScripter

unread,
Mar 6, 2025, 1:57:21 PMMar 6
to PyScripter
How did you add a second breakpoint on the same line?  In any case python only takes into account one breakpoint per line.
Also F8  steps through the code.   So it is normal that execution moves to the next statement. 

pjinturin

unread,
Mar 6, 2025, 2:11:49 PMMar 6
to PyScripter
Sorry, maybe I wasn't clear. The breakpoint with the ignore count of 100 goes on  the line with "fn(j)". Then, when it stops, the second breakpoint goes on the line with "pass". This is with python 3.13.2.

PyScripter

unread,
Mar 6, 2025, 4:54:53 PMMar 6
to PyScripter
I see.  This is a bug in the new debugger.  See https://github.com/python/cpython/pull/124533#issuecomment-2704961232.   I will provide a fix with the next release.

pjinturin

unread,
Mar 6, 2025, 5:24:10 PMMar 6
to PyScripter
Great, thank you! Sorry, I should probably have noticed that this was a debugger problem and had nothing to do with the "ignore count" feature.

PyScripter

unread,
Mar 6, 2025, 6:12:04 PMMar 6
to PyScripter
The issue has now been fixed and the fix will be available with the next release.  Thanks for reporting this.
Reply all
Reply to author
Forward
0 new messages