[IronPython] pdb with IronPython 2.6 beta 2

Michael Foord fuzzyman at voidspace.org.uk
Mon Jul 27 17:35:27 CEST 2009


Hello all,

I've been trying to use the pdb module with IronPython 2.6beta2 and the
interactive interpreter (with the -X:FullFrames command line option).
I've only used pdb with the set_trace function, but I couldn't get *any*
of it to work in my brief exploration.

I've posted my interactive session below in case anyone can point out
what I'm doing wrong:

IronPython 2.6 Beta 2 (2.6.0.20) on .NET 2.0.50727.4016
Type "help", "copyright", "credits" or "license" for more information.
>>> import pdb
>>> def f():
...      a = 3
...      pdb.set_trace()
...
>>> f()
>>> print a
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'a' is not defined
>>> pdb.run('f()')
>>> def f():
...  a = 3
...  foo
...
>>> pdb.pm()
> <stdin>(1)<module>()
(Pdb) a
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\IronPython 2.6\Lib\pdb.py", line 1232, in pm
  File "C:\Program Files\IronPython 2.6\Lib\pdb.py", line 1229, in
post_mortem
  File "C:\Program Files\IronPython 2.6\Lib\pdb.py", line 194, in
interaction
  File "C:\Program Files\IronPython 2.6\Lib\cmd.py", line 142, in cmdloop
  File "C:\Program Files\IronPython 2.6\Lib\pdb.py", line 252, in onecmd
  File "C:\Program Files\IronPython 2.6\Lib\cmd.py", line 219, in onecmd
  File "C:\Program Files\IronPython 2.6\Lib\pdb.py", line 702, in do_args
SystemError: Object reference not set to an instance of an object.
>>>

For the record I tried the same with CPython and it worked as expected:

Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pdb
>>> def f():
...  a = 3
...  pdb.set_trace()
...
>>> f()
--Return--
> <stdin>(3)f()->None
(Pdb) a
(Pdb) print a
3
(Pdb)

 >>> def f():
...  a = 6
...  foo
...
 >>> f()
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "<stdin>", line 3, in f
NameError: global name 'foo' is not defined
 >>> pdb.pm()
 > <stdin>(3)f()
(Pdb) a
(Pdb) print a
6
(Pdb)



All the best,

Michael

-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog




More information about the Ironpython-users mailing list