Thanks for your help (again) Dino. It turns out after a lot more playing around that mdbg does work fairly well. I found out that there is a bit more of a learning curve to mdbg than I thought (who knew that you had to tell it which thread to attach to for goodness sake)! Anyhow, I got it far enough along for my purposes - so thanks. I am trying to debug code in a file fortunately. For those people tempted to try this....you need to start mdbg and then issue the following commands and you too can debug your IP code through mdbg:
mode nc on (run your stuff in a seperate process) path <path to where your program lives> (do not use double quotes) run "<path to where ipy.exe lives>" "<path to your python code> " (do use double quotes - how consistent) t 0 b <your program name>:<a line where you want the thing to stop at> g when it does stop you can enter sh - to list lines of code. p - to print out local variables etc. If you try to single step - that does not work so well (you will end up in IP itself or some other oddball place)....but you can set lots of breakpoints and use those. For those of you who can compile things you can get the source for mdbg and then load the semi-gui extension and that might help. David [EMAIL PROTECTED] wrote on 09/13/2007 11:33:30 AM: > What are you trying to debug in particular? Is it a file of Python > code or code you enter at the console? > > Code in a file is generally debuggable (presumably by all debuggers) > where code entered at the console, via eval or exec, is not > debuggable - by any debugger. The reason for this is that the > latter is generated using DynamicMethod's (which are fully > collectable by the GC) but don't have any debugging support at the CLR level. > > Additionally we did run into some issues when we tried testing > IronPython w/ MDBG and these could be what you're hitting. If we > compile a file such as: > > def foo(): > print 'hello' > > def bar(): > print 'goodbye' > > foo() > bar() > > We end up creating 3 (really more, but only 3 are important) methods > in a single type. The first two methods are foo and bar. The 3rd > method is an Initialize method which is the file of code which > contains foo and bar. Because of this and the fact that the code > gets generated w/ Ref Emit MDBG receives multiple notifications of > when a symbols are loaded. On those notifications it updates it's > source mapping and because there is overlap between the methods it > gets confused. The MDBG team has a bug on this issue as they > recognize it'll be a common problem w/ dynamic languages. > Unfortunately I'm not sure if they fixed it yet - they're busy > working on Silverlight and we haven't pushed them very hard on the issue. > > In theory it should be possible to write an MDBG extension that can > successfully set breakpoints in this case (or fix the bug in the > publicly available mdbg source code) but by default you're going to > have a difficult time with it. > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:users- > [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] > Sent: Thursday, September 13, 2007 5:21 AM > To: Discussion of IronPython > Subject: Re: [IronPython] how to get mdbg to work with IP - or is it > even possible? > > Hi - Thanks Dave, > > But while that shows how to embed Ironpython in Mdbg, I am looking to use > Mdbg to debug IronPython > programs/scripts. When I do this now with Clrdbg I can load the source > and step through it, set break points etc. > With Mdbg, if I use a self compiled version of Ironpython with the pdb > files in place I can see the IronPython source > and put breakpoints in it. However, I cannot do anything at the > Ironpython program/script level. If I use a release version > of Ironpython (or the binary) then I can't get anything useful to happen. > > David > > [EMAIL PROTECTED] wrote on 09/12/2007 07:48:26 PM: > > > This link (http://blogs.msdn. > > com/jmstall/archive/2005/08/31/Mdbg_Python_ext.aspx) is a bit out of > > date, but hopefully points you in the right direction. > > > > Dave > > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:users- > > [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] > > Sent: Wednesday, September 12, 2007 4:21 PM > > To: Discussion of IronPython > > Subject: [IronPython] how to get mdbg to work with IP - or is it > > even possible? > > > > I can debug IP 2 programs fairly nicely with clrdbg even setting break > > points and examining variables but I have tried to get mdbg (and cordbg) > > to work with no success. I am interested in mdbg because I would like > to > > learn more about how debugging support works with the clr and with IP in > > particular and the source is available for mdbg. Has anyone had success > > with mdbg and Ironpython or does this just not work. If it can work can > > you give me some clues about the commands that make it work? > > > > Thanks! > > > > David > > _______________________________________________ > > Users mailing list > > [email protected] > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > > Users mailing list > > [email protected] > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > [email protected] > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > [email protected] > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
