Thursday, July 16, 2009


For IronPython users interested in tool support the big new feature in IronPython 2.6 is the support for Python stack frames and all that comes along with it. Not a small part of this is that pdb, the standard library Python debugger, will work with IronPython - yay!

Harry Pierson (IronPython program manager for Microsoft) has a new blog entry detailing the new assembly that will come with IronPython 2.6 (but will actually be part of the Dynamic Language Runtime) to support this:
If you’ve compiled IronPython from source recently, you may have noticed a new DLL: Microsoft.Scripting.Debugging. This DLL contains a lightweight, non-blocking debugger for DLR based languages that is going to enable both new scenarios as well as better compatibility with CPython. Needless to say, we’re very excited about it.


Of course, we hide all this DLR Debugger goo from you in IronPython. Python already has a mechanism for doing traceback debugging – sys.settrace. Our ITraceCallback, PythonTracebackListener, wrapps the DLR Debugger API to expose the sys.settrace API. That makes this feature a twofer – new capability for IronPython + better compatibility with CPython. Instead of needing a custom tool (i.e. ipydbg) you can now use PDB from the standard Python library

For those hosting IronPython, we also have a couple of static extension methods in our hosting API (look for the SetTrace functions in IronPython\Hosting\Python.cs). These are simply wrappers around sys.settrace, so it has the same API regardless if you access it from inside IronPython or from the hosting API. But if you’re hosting IronPython in a C# application, those extension methods are very convenient to use.

This debugger will be in our regular releases of IronPython as of 2.6 beta 2 which is scheduled to drop at the end of this month.

So the new APIs mean better debugging (potentially) for all DLR languages, better debugging for IronPython developers and better debugging for those embedding IronPython.

Shortly after this blog entry, Seo Sanghyeon (maintainer of FePy - the community edition of IronPython) posted this email to the IronPython mailing list:
Now I updated FePy's NAnt build file to include newly introduced Microsoft.System.Debugging.dll
So we're looking good for a long awaited fresh release of FePy when IronPython 2.6 is released.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.