continue out of a loop in pdb

Diez B. Roggisch deets at nospam.web.de
Sun May 14 18:56:50 EDT 2006


> the code works with no problem, I am playing around with the pdb, i.e
> 
> ****************
> from pdb import *
> set_trace() 
> 
> for i in range(1,500000):
>     print i
> print "tired of this"
> print "I am out"
> ****************
> 
> fred at debian:~/python/practic$ python practic.py 
>> /home/fred/python/practic/practic.py(4)?()
> -> for i in range(1,500000):
> (Pdb) n
>> /home/fred/python/practic/practic.py(5)?()
> -> print i
> (Pdb) n
> 1
>> /home/fred/python/practic/practic.py(4)?()
> -> for i in range(1,500000):
> (Pdb) b 6
> Breakpoint 1 at /home/fred/python/practic/practic.py:6
> (Pdb) c
>> /home/fred/python/practic/practic.py(5)?()
> -> print i <<<< I expected (print "tired of this")
> (Pdb) 


In TFM it says that set_trace() puts a breakpoint to the current frame. 
I admit that I also wouldn't read that as "each and every instruction in 
this very frame", but that is what essentially happens. I think the docs 
could need some enhancement here. Try debugging a called function, there 
things will work as expected.

Diez



More information about the Python-list mailing list