Skip to content

Commit 963bcc8

Browse files
authored
[3.6] bpo-34007: Skip traceback tests if the Program Counter is not available. (GH-9022)
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. (cherry picked from commit f2ef51f) Co-authored-by: Pablo Galindo <[email protected]>
1 parent 9eeecfd commit 963bcc8

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
@@ -212,6 +212,15 @@ def get_stack_trace(self, source=None, script=None,
212212
for line in errlines:
213213
if not line:
214214
continue
215+
# bpo34007: Sometimes some versions of the shared libraries that
216+
# are part of the traceback are compiled in optimised mode and the
217+
# Program Counter (PC) is not present, not allowing gdb to walk the
218+
# frames back. When this happens, the Python bindings of gdb raise
219+
# an exception, making the test impossible to succeed.
220+
if "PC not saved" in line:
221+
raise unittest.SkipTest("gdb cannot walk the frame object"
222+
" because the Program Counter is"
223+
" not present")
215224
if not line.startswith(ignore_patterns):
216225
unexpected_errlines.append(line)
217226

0 commit comments

Comments
 (0)