Skip to content

Commit 542c061

Browse files
committed
gh-91960: Skip test_gdb if gdb cannot retrive Python frames
When Python is built with "clang -Og", gdb can fail to retrive the 'frame' parameter of _PyEval_EvalFrameDefault(). In this case, tests like py_bt() are likely to fail. Without getting access to Python frames, python-gdb.py is mostly clueless on retrieving the Python traceback.
1 parent 39376cb commit 542c061

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Lib/test/test_gdb.py

+3
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ def get_stack_trace(self, source=None, script=None,
247247
for pattern in (
248248
'(frame information optimized out)',
249249
'Unable to read information on python frame',
250+
# gh-91960: On Python built with "clang -Og", gdb gets
251+
# "frame=<optimized out>" for _PyEval_EvalFrameDefault() parameter
252+
'(unable to read python frame information)',
250253
):
251254
if pattern in out:
252255
raise unittest.SkipTest(f"{pattern!r} found in gdb output")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Skip ``test_gdb`` if gdb is unable to retrieve Python frame objects: if a
2+
frame is ``<optimized out>``. When Python is built with "clang -Og", gdb can
3+
fail to retrive the *frame* parameter of ``_PyEval_EvalFrameDefault()``. In
4+
this case, tests like ``py_bt()`` are likely to fail. Without getting access
5+
to Python frames, ``python-gdb.py`` is mostly clueless on retrieving the
6+
Python traceback. Patch by Victor Stinner.

0 commit comments

Comments
 (0)