[issue1750076] Python 2.5+ skips while statements in debuggers

Amaury Forgeot d'Arc report at bugs.python.org
Tue Jan 29 22:48:31 CET 2008


Amaury Forgeot d'Arc added the comment:

Here is an attempt to correct the problem, with unit tests.

I removed half of the trick marked by a "XXX(nnorwitz)", by adding an
attribute to "struct instr" (this attribute is a bitfield and does not
increase the memory usage). FOR_ITER is no more special-cased in
assemble_lnotab.
Note that the attribute is not always set: only when the target block
has already been filled with instructions. Hopefully this is the case
for the beginning of loops (while & for).

Then the second part of the trick (c->u->u_lineno_set = false, already
used in compiler_for) can be applied to compiler_while. Don't know how
to write this better.

Nir's examples now correctly generate the 3 offsets, and the unit test
checks that a "line" event is repeatedly emitted for the "while" condition.

----------
nosy: +amaury.forgeotdarc
Added file: http://bugs.python.org/file9319/while_lnotab.patch

_____________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1750076>
_____________________________________


More information about the Python-bugs-list mailing list