[Python-Dev] The step command of pdb is broken

Xavier de Gaye xdegaye at gmail.com
Mon Apr 30 12:31:40 CEST 2012

Issue http://bugs.python.org/issue13183 raises the point that the step
command of pdb is broken. This issue is 6 months old. A patch and test
case have been proposed. The 'Lifecycle of a Patch' at
http://docs.python.org/devguide/patch.html says
If your patch has not received any notice from reviewers (i.e., no
comment made) after a substantial amount of time then you may email
python-dev at python.org asking for someone to take a look at your patch.
I am the author of pyclewn, a Vim front end to pdb and gdb, and I
would be grateful for any progress on this issue.

The following pdb session shows the problem when running the three
modules main.py, foo.py and bar.py. After the second step command, pdb
does not stop (as it should) at lines foo.py:5 and foo.py:6, nor does
it stop to print the return value of increment().
     1  import foo
     3  result = foo.increment(100)
     4  print('result', result)
     1  import bar
     3  def increment(arg):
     4      v =  bar.value()
     5      result = arg + v
     6      return result
     1  def value():
     2      return 5
$ python -m pdb main.py
> /path_to/main.py(1)<module>()
-> import foo
(Pdb) import sys; sys.version
'3.3.0a2+ (default:2c27093fd11f, Apr 30 2012, 10:51:35) \n[GCC 4.3.2]'
(Pdb) break bar.py:2
Breakpoint 1 at /path_to/bar.py:2
(Pdb) continue
> /path_to/bar.py(2)value()
-> return 5
(Pdb) step
> /path_to/bar.py(2)value()->5
-> return 5
(Pdb) step
> /path_to/main.py(4)<module>()
-> print('result', result)


More information about the Python-Dev mailing list