winpdb icon indicating copy to clipboard operation
winpdb copied to clipboard

Fix a bug

Open jfongattw opened this issue 4 months ago • 1 comments

In CalcScopeLine(), when insert the line "print(rvl)" below "rvl.reverse()", sometimes you can see wrong lineno which is larger than the debugee file has. This error was caused by CalcValidLines() which is buggy. Replace it with the following new def can get rid of this bug and makes rpdb2 more reliable.

import dis def CalcValidLines(code): return sorted({lineno for _, lineno in dis.findlinestarts(code)})

jfongattw avatar Sep 03 '25 09:09 jfongattw

Hi

Good one. Can you propopose a pull request please ?

Thanks,

Philippe

pfremy avatar Sep 03 '25 20:09 pfremy