-
-
Notifications
You must be signed in to change notification settings - Fork 31k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-45637: Remove broken fallback in gdb helpers to obtain frame variable #29257
Conversation
This will not fix the buildbot, but at least won't give incorrect results. We need to make sure that we bail out if the frame is not optimized, but that must be done separately |
@markshannon We should maybe place the current frame in some place that we know is not going to get optimized so we can retrieve it |
Yes, let's do that. |
But let's do it properly, and not in this PR. Could we restrict this PR to fixing gdb support, thanks. If we move the frame to the cframe, then it should be removed from the thread state. |
The current frame in the thread state is what makes external inspection tools work. Of you remove it from there you make it impossible to fetch the current frame from the _PyRuntime structure. That's a no go Or are you talking about removing |
I think this approach is the best. We cannot just remove the bad gdb part because other tests rely on it unfortunately, so we are currently in this half broken state. Adding a redundant current frame to the CFrame is a negligible cost for having the GDB bindings work on all these cases |
For some reason, removing the fallback this breaks
|
Let's land #29267 and then I can remove my changes for the cframe from here |
@markshannon Rebased, please review again |
Because @pablogsal does that sound right to you? |
if cframe is None: | ||
return None | ||
frame = PyFramePtr(cframe["current_frame"].dereference()) | ||
if frame and not frame.is_optimized_out(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be impossible for frame to be "optimized out" here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if impossible, because optimized out is a value that GDB cannot read, but I agree is certainly very likely never going to be True but I think is still good for safety. You want to remove the check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Up to you. I'm just guessing here, really.
That's sadly not true, is optimized out in some of the builds with
|
@markshannon I have tried with several gcc/gdb versions and all have the same behaviour I showed in the previous comment once you use |
Oh well. Let's just do the best we can, then. |
We could mark stuff as |
@markshannon I am not super fond of this idea, but I am curious to know what you think |
https://bugs.python.org/issue45637