Skip to content

Commit f2ef51f

Browse files
authored
bpo-34007: Skip traceback tests if the Program Counter is not available. (GH-9018)
Sometimes some versions of the shared libraries that are part of the traceback are compiled in optimised mode and the Program Counter (PC) is not present, not allowing gdb to walk the frames back. When this happens, the Python bindings of gdb raise an exception, making the test impossible to succeed.
1 parent 95d630e commit f2ef51f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Lib/test/test_gdb.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,15 @@ def get_stack_trace(self, source=None, script=None,
206206
for line in errlines:
207207
if not line:
208208
continue
209+
# bpo34007: Sometimes some versions of the shared libraries that
210+
# are part of the traceback are compiled in optimised mode and the
211+
# Program Counter (PC) is not present, not allowing gdb to walk the
212+
# frames back. When this happens, the Python bindings of gdb raise
213+
# an exception, making the test impossible to succeed.
214+
if "PC not saved" in line:
215+
raise unittest.SkipTest("gdb cannot walk the frame object"
216+
" because the Program Counter is"
217+
" not present")
209218
if not line.startswith(ignore_patterns):
210219
unexpected_errlines.append(line)
211220

0 commit comments

Comments
 (0)