continue out of a loop in pdb

R. Bernstein rocky at panix.com
Wed May 24 04:46:23 CEST 2006


Gary Wessle <phddas at yahoo.com> writes:

> Hi
> 
> using the debugger, I happen to be on a line inside a loop, after
> looping few times with "n" and wanting to get out of the loop to the
> next line, I set a break point on a line after the loop structure and
> hit c, that does not continue out of the loop and stop at the break
> line, how is it down, I read the ref docs on pdb but could not figure
> it out.

The command you are probably looking for is jump. 

http://bashdb.sourceforge.net/pydb/pydb/lib/subsubsection-resume.html

It is also documented in the stock python debugger
http://docs.python.org/lib/debugger-commands.html

Here's an example:

pdb ~/python/ptest.py
> /home/rocky/python/ptest.py(2)?()
-> for i in range(1,10):
(Pdb) step
> /home/rocky/python/ptest.py(3)?()
-> print i
(Pdb) list
  1     #!/bin/python
  2     for i in range(1,10):
  3  ->     print i
  4     print "tired of this"
[EOF]
(Pdb) jump 4
> /home/rocky/python/ptest.py(4)?()
-> print "tired of this"
(Pdb) 




More information about the Python-list mailing list