bpo-30983: eval frame rename in pep 0523 broke gdb's python extension by bcap · Pull Request #2803 · python/cpython (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation6 Commits1 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

bcap

pep 0523 renames PyEval_EvalFrameEx to _PyEval_EvalFrameDefault while the gdb python extension only looks for PyEval_EvalFrameEx to understand if it is dealing with a frame.

Final effect is that attaching gdb to a python3.6 process doesnt resolve python objects. Eg. py-list and py-bt dont work properly.

This patch fixes that. Tested locally on python3.6

pep 0523 renames PyEval_EvalFrameEx to _PyEval_EvalFrameDefault while the gdb python extension only looks for PyEval_EvalFrameEx to understand if it is dealing with a frame.

Final effect is that attaching gdb to a python3.6 process doesnt resolve python objects. Eg. py-list and py-bt dont work properly.

This patch fixes that. Tested locally on python3.6

@the-knights-who-say-ni

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

Thanks again to your contribution and we look forward to looking at it!

@bcap

My first python upstream patch. PSF contributor agreement signed

brettcannon

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

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?

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.

brettcannon

@ambv

@bedevere-bot

ambv pushed a commit to ambv/cpython that referenced this pull request

Aug 14, 2017

@bcap

…ension (pythonGH-2803)

pep 0523 renames PyEval_EvalFrameEx to _PyEval_EvalFrameDefault while the gdb python extension only looks for PyEval_EvalFrameEx to understand if it is dealing with a frame.

Final effect is that attaching gdb to a python3.6 process doesnt resolve python objects. Eg. py-list and py-bt dont work properly.

This patch fixes that. Tested locally on python3.6 (cherry picked from commit 2e0f4db)

ambv added a commit that referenced this pull request

Aug 14, 2017

@ambv

…ension (GH-2803) (#3090)

pep 0523 renames PyEval_EvalFrameEx to _PyEval_EvalFrameDefault while the gdb python extension only looks for PyEval_EvalFrameEx to understand if it is dealing with a frame.

Final effect is that attaching gdb to a python3.6 process doesnt resolve python objects. Eg. py-list and py-bt dont work properly.

This patch fixes that. Tested locally on python3.6 (cherry picked from commit 2e0f4db)

vstinner added a commit that referenced this pull request

Aug 16, 2017

@vstinner

vstinner added a commit that referenced this pull request

Aug 16, 2017

@vstinner

This reverts commit f978405.

This reverts commit 2e0f4db.