classification
Title: Pdb breakpoints don't work on lines without bytecode
Type: behavior Stage: needs patch
Components: Library (Lib) Versions: Python 3.2, Python 3.1, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, inducer
Priority: normal Keywords:

Created on 2009-06-22 14:09 by inducer, last changed 2010-10-12 16:33 by r.david.murray.

Messages (2)
msg89597 - (view) Author: Andreas Kloeckner (inducer) Date: 2009-06-22 14:09
Take this program:

8< -----------------------------------------------
print "START"

a = [
        1
        for i in range(10)]
8< -----------------------------------------------

as "a.py", run "python -m pdb a.py", say "b 3" to set a breakpoint on
line 3. Say "c" to start execution. Watch the program finish without
ever hitting the breakpoint.

The problem is that line 3 has no bytecode generated for it, so there's
nothing to break on. Pdb should provide feedback in this case. I'm the
author of PuDB, and I've written code to check for this condition Please
feel free to steal that code, here:

http://is.gd/19fvD
msg109903 - (view) Author: Mark Lawrence (BreamoreBoy) Date: 2010-07-10 17:47
The OP has offered source code which fixes this issue, see msg89597.
History
Date User Action Args
2010-10-12 16:33:27r.david.murraysetnosy: + georg.brandl, - BreamoreBoy
2010-07-10 17:47:09BreamoreBoysetversions: + Python 3.2, - Python 2.6, Python 2.5
nosy: + BreamoreBoy

messages: + msg109903

stage: needs patch
2009-06-22 14:09:13inducercreate