[IronPython] Debugging embedded IP?

Dino Viehland dinov at exchange.microsoft.com
Wed Apr 11 21:46:16 CEST 2007


You can call PythonEngine.CreateOptimizedModule on the engine to create the module which will be fully debuggable.  After you get the module back you'll need to inject your runtime objects and then call Execute on the module.  The referenced assemblies happen at the engine level rather than the module level so you can do those whenever.  If you want to also import them on behalf of the user you can call the Import API on the OptimizedEngineModule class.

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Matthew Swank
Sent: Wednesday, April 11, 2007 11:56 AM
To: 'Discussion of IronPython'
Subject: Re: [IronPython] Debugging embedded IP?

I would also like to debug my scripts, but I'm not sure how I could import
them in the way you describe.

My application provides a context in which a script can execute.  From
inside C# I create a module that has certain assemblies referenced, and
makes certain runtime objects available to the script. I then use
ExecuteFile to run the script in the context of the prepared module.  Is
there any way to attach the debugger to scripts run in this fashion?


Matt
-----Original Message-----
From: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland
Sent: Wednesday, April 11, 2007 10:58 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Debugging embedded IP?

The answer to this all depends upon how the scripts are getting executed.
If you have a bunch of .py files which are getting loaded as modules from
disk (e.g. your typical import scenario) and you haven't used the
-X:GenerateAsSnippets mode then the answer is yes.

You should be able to attach to the process doing the embedding, open the
.py file in VS and set breakpoints and step through it.  If you build your
own copy of IronPython.dll then you'll also be able to step from the script
code to the IronPython code.

-----Original Message-----
From: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Adam Pletcher
Sent: Wednesday, April 11, 2007 8:21 AM
To: Discussion of IronPython
Subject: [IronPython] Debugging embedded IP?

I'm giving IronPython a test run, and definitely like it so far.  I have
the VS 2005 debugger working with IP scripts, which is pretty slick.

One thing I'm trying to determine is if it's possible to use a debugger
(VS, CLR or otherwise) to debug scripts run by an embedded IronPython
interpreter.  The turorials cover how to embed, then how debug, but not
together.

Any pointers/links appreciated.

--
Adam Pletcher
Senior Technical Artist
Volition / THQ
_______________________________________________
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

_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list