ptvsd does not properly support generator methods?

Jan 17, 2015 at 12:00 AM
I'm using pdvsd to debug an IronPython script, and as soon as I step into a generator function I lose all variable inspection capabilities - all variables say they're undefined. Is this a known issue? (vs2010 pytools 2.1, ironpython 2.7.4)
Coordinator
Jan 17, 2015 at 2:51 AM
It's not a known issue, but I suspect it's more likely to be an IronPython limitation. Locals inspection is driven by what the implementation reports in frame objects returned via sys._getframe, so if that doesn't report the values in generators, that would be the reason why. This definitely works fine in CPython.

I suspect IronPython has to jump through a lot more hoops to implement generators compared to CPython (the latter implements its own execution stack in a way that is generator-aware, whereas IronPython has to make do with CLR stack), and this is one of the corner cases.
Coordinator
Jan 17, 2015 at 2:53 AM
Just took a quick look, and it looks like generators have a really weird frame returned from _getframe that only has two entries in locals called tuple and tupleArg, and no entries for the actual locals. So yeah, this is an IronPython quirk for sure.