Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix `up` through generators in postmortem debugger; closes #6251 #11266
By passing the lowest traceback element into the debugger, we require it to use frame.f_back to find older frames. However, f_back is always None for generator frames in the postmortem context. By providing a higher-up traceback element, pdb can traverse down the traceback.tb_next links, which do work correctly across generator calls.
...or at least, that's my understanding of the situation after spending half an hour researching the issue. This fix seems to work for my use cases, but I don't really understand the depths of pdb and can't tell if this may cause adverse affects elsewhere.
(I would also love to write a test for this, but I have no idea if we can or want to drive the debugger automatically for tests?)
Ok, I'm writing some test, but this seem to not be quite right:
It show frames in the wrong place (or re-go through frames it should not)
I'm going to try to polish the tests framework to test that, and we can figure out what to do. I'm going to likely push this thing for 7.1
Okay, I read the pdb/bdb source more carefully and force pushed what should be a real fix. Explanation in the commit message.
The takeaway here for future reference is that the only place the frame passed into