[IronPython] pdb with IronPython 2.6 beta 2
Michael Foord
fuzzyman at voidspace.org.uk
Mon Jul 27 17:48:38 CEST 2009
Issue 23650
http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=23650
Michael Foord
Dino Viehland wrote:
> This is what we've tested so far :)
>
>
>>>> import pdb
>>>> def f():
>>>>
> ... print 'hi'
> ... print 'goodbye'
> ...
>
>>>> pdb.runcall(f)
>>>>
>> <stdin>(2)f()
>>
> (Pdb) s
> hi
>
>> <stdin>(3)f()
>>
> (Pdb) s
> goodbye
> --Return--
>
>> <stdin>(3)f()->None
>>
> (Pdb) s
>
>>>> pdb.runcall(f)
>>>>
>> <stdin>(2)f()
>>
> (Pdb) ?
>
> Unfortunately there don't seem to be pdb tests so it's hard for us
> to say what works and doesn't yet. Could you open a bug on this and
> that way it won't fall off our radar?
>
>
>> -----Original Message-----
>> From: users-bounces at lists.ironpython.com [mailto:users-
>> bounces at lists.ironpython.com] On Behalf Of Michael Foord
>> Sent: Monday, July 27, 2009 8:35 AM
>> To: Discussion of IronPython
>> Subject: [IronPython] pdb with IronPython 2.6 beta 2
>>
>> 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
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog
More information about the Ironpython-users
mailing list