Skip to content

bpo-45637: Fix cframe-based fallback in the gdb helpers #29515

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

Merged
merged 1 commit into from
Nov 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Tools/gdb/libpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -1797,14 +1797,14 @@ def is_gc_collect(self):

def get_pyop(self):
try:
frame = self._gdbframe.read_var('frame')
frame = PyFramePtr(frame)
if not frame.is_optimized_out():
return frame
# frame = self._gdbframe.read_var('frame')
# frame = PyFramePtr(frame)
# if not frame.is_optimized_out():
# return frame
cframe = self._gdbframe.read_var('cframe')
if cframe is None:
return None
frame = PyFramePtr(cframe["current_frame"].dereference())
frame = PyFramePtr(cframe["current_frame"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems more correct. What does it fix?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pointer that we are getting was wrong. Seems that new versions of gdb still correct this fall and doesn't do anything if is a value and not a pointer, but old versions like the one FreeBSD get garbage

if frame and not frame.is_optimized_out():
return frame
return None
Expand Down