Skip to content

bpo-30983: eval frame rename in pep 0523 broke gdb's python extension #2803

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
Aug 14, 2017
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
6 changes: 4 additions & 2 deletions Tools/gdb/libpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -1502,8 +1502,10 @@ def is_python_frame(self):
return False

def is_evalframeex(self):
'''Is this a PyEval_EvalFrameEx frame?'''
if self._gdbframe.name() == 'PyEval_EvalFrameEx':
'''Is this a PyEval_EvalFrameEx or _PyEval_EvalFrameDefault (PEP 0523)
frame?'''
if self._gdbframe.name() in ('PyEval_EvalFrameEx',
Copy link
Member

Choose a reason for hiding this comment

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

Should PyEval_FrameEx even stay as an option if this simply won't work if someone sets a eval frame function? I mean if the gdb support is so reliant on the specifics of PyEval_EvalFrameDefault then maybe it isn't worth trying to support PyEval_EvalFrameEx?

Copy link
Contributor

Choose a reason for hiding this comment

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

We want to keep the old name because the same python-gdb.py can be used to debug also older Python core dumps. We even keep the syntax compatible with 2.6 for it to be linkable with older gdbs. There's a comment on the top:

# NOTE: some gdbs are linked with Python 3, so this file should be dual-syntax
# compatible (2.6+ and 3.0+).  See #19308.

'_PyEval_EvalFrameDefault'):
'''
I believe we also need to filter on the inline
struct frame_id.inline_depth, only regarding frames with
Expand Down