mirror of
https://github.com/python/cpython
synced 2024-09-05 00:05:39 +00:00
bpo-45637: Remove broken fallback in gdb helpers to obtain frame variable (GH-29257)
This commit is contained in:
parent
6a1cc8bf8a
commit
f4c03484da
|
@ -823,6 +823,8 @@ def test_bt_full(self):
|
|||
foo\(1, 2, 3\)
|
||||
''')
|
||||
|
||||
@unittest.skipIf(python_is_optimized(),
|
||||
"Python was compiled with optimizations")
|
||||
def test_threads(self):
|
||||
'Verify that "py-bt" indicates threads that are waiting for the GIL'
|
||||
cmd = '''
|
||||
|
|
|
@ -1801,17 +1801,13 @@ def get_pyop(self):
|
|||
frame = PyFramePtr(frame)
|
||||
if not frame.is_optimized_out():
|
||||
return frame
|
||||
# gdb is unable to get the "frame" argument of PyEval_EvalFrameEx()
|
||||
# because it was "optimized out". Try to get "frame" from the frame
|
||||
# of the caller, _PyEval_Vector().
|
||||
orig_frame = frame
|
||||
caller = self._gdbframe.older()
|
||||
if caller:
|
||||
frame = caller.read_var('frame')
|
||||
frame = PyFramePtr(frame)
|
||||
if not frame.is_optimized_out():
|
||||
return frame
|
||||
return orig_frame
|
||||
cframe = self._gdbframe.read_var('cframe')
|
||||
if cframe is None:
|
||||
return None
|
||||
frame = PyFramePtr(cframe["current_frame"].dereference())
|
||||
if frame and not frame.is_optimized_out():
|
||||
return frame
|
||||
return None
|
||||
except ValueError:
|
||||
return None
|
||||
|
||||
|
|
Loading…
Reference in a new issue