ironpython2 icon indicating copy to clipboard operation
ironpython2 copied to clipboard

IronPython modules marked as JIT optimized during debugging

Open qubitron opened this issue 6 years ago • 3 comments

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.

qubitron avatar Apr 19 '18 23:04 qubitron

It seems like the user says the issue is fixed (unless I am not seeing some of the details of the issue).

slide avatar May 05 '18 13:05 slide

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;

qubitron avatar Jun 19 '18 01:06 qubitron

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.

slide avatar Jun 19 '18 13:06 slide