pdb and breakpoints

Justin Shaw wyojustin at hotmail.com
Thu Jan 2 16:43:13 EST 2003


"Christopher Fonnesbeck" <chris at fonnesbeck.org> wrote in message
news:877kdnqsix.fsf at fonnesbeck.org...
> I am running into a problem using python and the pdb. I set breakpoints in
a class within which I have set a trace, but when I hit "c" to continue to
the next breakpoint, pdb blows right by them. I have set the breakpoint in a
for loop, so that it should stop at the first line (non-commented) in the
loop every time. Anyone have an idea of what I may be doing wrong?
>
> Thanks in advance,

Maybe that code is not being executed.  Set up a simple example and try it
out there.

Justin

# -- simple.py -- #
for i in range(4):
    print i

# -- end simple.py -- #

>>> import pdb
>>> import simple
0
1
2
>>> pdb.run('reload(simple)')
> <string>(0)?()
(Pdb) s
> <string>(1)?()
(Pdb) s
> C:\Python\Python22\simple.py(0)?()
(Pdb) b 2
Breakpoint 1 at C:\Python\Python22\simple.py:2
(Pdb) c
> C:\Python\Python22\simple.py(2)?()
-> print i
(Pdb) c
0
> C:\Python\Python22\simple.py(2)?()
-> print i
(Pdb) c
1
> C:\Python\Python22\simple.py(2)?()
-> print i
(Pdb) c
2
> C:\Python\Python22\simple.py(2)?()
-> print i
(Pdb) c
3







More information about the Python-list mailing list