[IronPython] Using mdbg from IronPython

David.Lawler at franke.com David.Lawler at franke.com
Tue Sep 18 22:51:52 CEST 2007

I am experimenting and learning about debugging by playing with the source 
code to mdbg and the various samples.
I thought it would be fun to take the mdbg c# example program that prints 
out modules as they are loaded and make a
version in IronPython (I tried IP 1.1 and 2.0A3):

import clr


from Microsoft.Samples.Debugging.MdbgEngine import *

debugger = MDbgEngine()
debugger.Options.CreateProcessWithNewConsole = True
debugger.Options.StopOnModuleLoad = True

proc = debugger.CreateProcess("ipy.exe", "", DebugModeFlag.Debug, None)

while (proc.IsAlive):
    o = proc.StopReason
    if (isinstance(o) == ModuleLoadedStopReason):
        print o.Module.CorModule.Name

print "done"

Original c# program link: 

Unfortunately, it does not work.  The call to proc.Go().WaitOne() never 
returns and ipy.exe launches - but nothing is
displayed in the window.  What am I doing wrong (or is this just too weird 
for IronPython to handle)?  Thanks,


More information about the Ironpython-users mailing list