I have been experimenting with the debugging support for the
PythonEngine. When I use the following code I have several problems. PythonEngine _pe; EngineOptions options = new EngineOptions(); options.ClrDebuggingEnabled = true; _pe = new PythonEngine(options); _pe.ExecuteFile(@" <script> "); x = 1 y = 2 def Add(a, b): return a + b z = Add(x, y) print z I opened the script file in Visual Studio and placed a
breakpoint at the beginning of the file. The application runs and breaks at the
correct location. Stepping through the lines works, but I cannot see any values
of variables. When I try to step into the function I get a notification that
there is no source code available and I must show the disassembly. After I step
several times through the assembly I can return to the source code. I have looked at debugging ipy.exe and there I can see the
variables, but I still have the problem with stepping into a function. In
ipy.exe the script file is executed in a different way. Using the same method I
can also see the variables. I apparently don’t need to set ClrDebuggingEnabled. PythonEngine _pe; _pe = new PythonEngine(); OptimizedEngineModule engineModule =
_pe.CreateOptimizedModule(@" <script> ",
"__main__", true); engineModule.Execute(); Are you required to use an OptimizedEngineModule to be able
to debug? Am I forgetting some settings for debugging? Can I step directly into
a function without getting into the assembly? |
_______________________________________________ users mailing list users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com