continue out of a loop in pdb

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

Gary Wessle <phddas at> 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.

It is also documented in the stock python debugger

Here's an example:

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

More information about the Python-list mailing list