Skip to content

Commit 287c9e3

Browse files
bcapLukasz Langa
authored andcommitted
[3.6] bpo-30983: eval frame rename in pep 0523 broke gdb's python extension (GH-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)
1 parent f2d769d commit 287c9e3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
With PEP 523, gdb's Python integration stopped working properly for frames
2+
using the ``_PyEval_EvalFrameDefault`` function. Affected functionality
3+
included `py-list` and `py-bt`. This is now fixed. Patch by Bruno "Polaco"
4+
Penteado.

Tools/gdb/libpython.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,8 +1502,10 @@ def is_python_frame(self):
15021502
return False
15031503

15041504
def is_evalframeex(self):
1505-
'''Is this a PyEval_EvalFrameEx frame?'''
1506-
if self._gdbframe.name() == 'PyEval_EvalFrameEx':
1505+
'''Is this a PyEval_EvalFrameEx or _PyEval_EvalFrameDefault (PEP 0523)
1506+
frame?'''
1507+
if self._gdbframe.name() in ('PyEval_EvalFrameEx',
1508+
'_PyEval_EvalFrameDefault'):
15071509
'''
15081510
I believe we also need to filter on the inline
15091511
struct frame_id.inline_depth, only regarding frames with

0 commit comments

Comments
 (0)