ironpython2
ironpython2 copied to clipboard
IronPython modules marked as JIT optimized during debugging
We received a report from a Visual Studio customer that IronPython was generating assemblies in optimized mode even though they configured it to load as debug: https://developercommunity.visualstudio.com/content/problem/218002/debugger-step-f10-does-not-work-in-ironpython-vs-1.html
They had problems setting breakpoints, so I wanted to raise this on the IronPython repo in case this needs to be fixed in IronPython itself.
It seems like the user says the issue is fixed (unless I am not seeing some of the details of the issue).
Sorry for the delayed response, for some reason it is not shown in the comments, but the user worked around the issue by disabling the "Just My Code" feature in Visual Studio. The Just My Code feature looks at whether the module is optimized or not to determine whether debugging should be available for each module.
So we think the module is being emitted as optimized even though the user specified the debug flag using:
Dictionary<string, object> setup = new Dictionary<string, object>();
if (System.Diagnostics.Debugger.IsAttached)
setup["Debug"] = true;
In the stackoverflow item referenced in the issue, one of the commenters mentions the "Just My Code" thing. I will look into this, but from looking at the code, it seems like Debug mode generates debug symbols and not necessarily unoptimized modules.