[IronPython] How to do debugging for embedded usage

Martin Maly Martin.Maly at microsoft.com
Fri Nov 11 00:27:10 CET 2005


Sorry for delayed response...

This is actually a valid bug in our codegen. The actual cause is that when we generate module-level code, we output void method and "return 1" tries to generate return code which would, on IL level, attempt to return non-void value from void function (that is in addition to the fact that we should generate syntax error in such case just like CPython does - "return statement outside of the function")

Now the reason you see it when you use RunFile and not with ExecuteFile, is just the difference between the implementations of RunFile and ExecuteFile.

Martin


________________________________

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Angelo Xu
Sent: Tuesday, November 08, 2005 5:04 PM
To: Discussion of IronPython
Subject: Re: [IronPython] How to do debugging for embedded usage


Because i need to debug the embedded scripts, I changed from ExecuteFile(..) to RunFile(..), but the application will report "Common Language Runtime Detected an Invalid Program". I spent some time finding the reason. If i add statements such as "return False" "return 1" into the script, using RunFile(...) method will report the error, while executeFile works fine. The effect of using "IronPythonConsole scriptFilePath" just like using RunFile(...) method. I don't know why.


2005/11/4, Martin Maly <Martin.Maly at microsoft.com>:

Because it it generated as a code snippet into the snippet assembly which doesn't have association with the source file and therefore the debugger cannot make the connection between the code and the source file.

I'm going to look into whether this could get changed/fixed.

Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20051110/f6d1c0e5/attachment.html>


More information about the Ironpython-users mailing list